2

I have an SSIS package where I pull data from a 3rd party source into a CSV file.

I get this error:

"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.".

Cannot copy or convert flat file data for column "Description".

SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Flat File Destination" (20300) failed with error code 0xC02020A0 while processing input "Flat File Destination Input" (20304). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure."

There seems to be an invalid character causing this issue...

enter image description here

I tried to remove it using this code but still an issue...

enter image description here

3 Answers 3

2

You have to deal with the unicode replacement character by calling it what it is:

Row.Description = Row.Description.Replace(NCHAR(65533), "a")

EDIT:

I apologize as I first gave you a pseudo-SQL Server solution, but with some additional research learned that SSIS behaves a little differently. I'm linking my source that gives multiple solutions, and for an answer will include the first. It seems that you could add a derived column component that would allow you to add a new column (e.g. strDescription from your table using the Type Cast operator DT_STR which will convert the unicode to string. You should then be able to use this derived column in place of the original column in you CSV destination. source Hope that helps!

1
  • I get this error..."Name 'NCHAR' is not declared"
    – K09
    Jun 19, 2015 at 7:48
1

In the 'Data Conversion Transformation Editor' within the 'Data Flow', I had to convert the column as string[DT_STR] and set the Error and Truncation to 'Ignore Failure'.

enter image description here

-1

In Csv Connection manager, check Unicode. This should work for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.