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)
 SSIS Truncation on Derived Column

Author  Topic 

ITTrucker
Yak Posting Veteran

64 Posts

Posted - 2014-09-29 : 12:05:02
I'm using a SSIS package Flat File -> DB import and one of our customers sent us a flat file with data in the "State" column that was spelled out instead of the abbreviated 2 letters and my import failed. So I changed the column width in the flat file connection manager, advanced, to 20 and added a new derived column called State that replaces State with an expression of (SUBSTRING(State,1,2). I re-ran the import and it was fine. (I don't really care about the state so if something comes in as NE for New York instead of NE for Nebraska, that's fine)

But I'm getting a Validation warning saying the field might be truncated because the database has a length of 2 but the data flow column has a length of 20. I know that, that's what the derived column was for and it works fine.

I tried changing my derived column name to State2 but I get the same warning with State2 instead of State.

Can I get rid of the warning/message on the DFT control element and the data flow destination element?

ITTrucker
Yak Posting Veteran

64 Posts

Posted - 2014-10-16 : 14:26:28
So I'm not sure what the problem is with the replace, but instead of replacing the State column in the derived column section, I just added the 2 digit state as a new column and mapped off of that.

Warning is now gone from the package.

I would have liked the replace to work but this is an acceptable solution.
Go to Top of Page
   

- Advertisement -