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 2005 Forums
 SSIS and Import/Export (2005)
 Derived Column help

Author  Topic 

jbphoenix
Yak Posting Veteran

68 Posts

Posted - 2009-01-22 : 16:10:53
I have a flat file and some of the records contain a blank item number. If the item number is blank I need the description to say "NONE". My package goes like this - flat file source -> derived column -> data conversion -> ole db destination.

I get an error - Error: 0xC02020A1 at Data Flow Task, Flat File Source [1]: Data conversion failed. The data conversion for column "Description" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

I know the field size is plenty large to handle the description. If I open the flat file in excel and remove the lines with a blank item number and then run my package it works perfectly. I'm stuck trying to figure out how to remove the blank lines or put something in those fields to make the import work.

I created the derived column to try and handle my issue - here is what I have for the derived column.
ISNULL([Item Number]) ? Description == "NONE" : Description == Description

It seems like my derived column does nothing.

revelator
Starting Member

32 Posts

Posted - 2009-01-23 : 04:21:34
The original error seems to be before the derived column transform, so you need to redirect your error rows in the Flat File Source.

Also, the derived column expression should look something like...

ISNULL([Item Number]) ? "NONE" : Description




-----------------------------------
Waiting for the Great Leap Forwards
Go to Top of Page
   

- Advertisement -