Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 Concatinate a Derived Column

Author  Topic 

brubakerbr
Yak Posting Veteran

53 Posts

Posted - 2013-10-17 : 13:37:06
I am trying to create a derived column in my SSIS package that will Concatinate some data that I have been doing manually.

my expression is this:

"FEI" + " " + [SHIP TO WHSE] + " - " + [SHIP TO WHSE - NAME]

I have a report that has a column labeled `SHIP TO WHSE` and another labeled `SHIP TO WHSE - NAME`. In excel I usually create a new column and add FEI to the column and then concatinate the data in another new column to create a single name for a report. I would like to build this in SQL and automate its creation.

The above expression I thought would work to concatinate the data but it's not. The outcome should look like this.

FEI 3112 - Sandy

Any ideas why it's not working?

the Error message is telling me that the data types are incompatable for the " + " to work.



Brian D. Brubaker
Business Intelligence Analyst
Viega LLC

brubakerbr
Yak Posting Veteran

53 Posts

Posted - 2013-10-17 : 13:42:16
I just did a data conversion before the Derived column. It was the Branch Number that was causing the issue, I converted it to match the rest and it worked.

Brian D. Brubaker
Business Intelligence Analyst
Viega LLC
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-18 : 02:00:10
If possible try to bring it from source itself concatenated ie using SQL Command in your sourec if its OLEDB. that would be better than doing it in SSIS Derived column.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

brubakerbr
Yak Posting Veteran

53 Posts

Posted - 2013-10-25 : 08:15:33
The Source is Excel, the files are downloaded and saved to a folder then I grab them and convert the data. It's a process I had been doing manually in previous years with Excel but now there are too many rows to contend with so I am automating the majority of it in SQL.

Thank you for the advice though, I have another project ti I am working on where that process will be better than what I am currently doing.



Brian D. Brubaker
Business Intelligence Analyst
Viega LLC
Go to Top of Page
   

- Advertisement -