0

I have a flat file inside which contains a string with special character ¦. Also an SSIS package is used to move the contents of this flat file to a table. There are basically 3 compontes in the pacake 1. Flat file with connection 2. Derived Column 3. OLEDB connection to insert data to table

And when I am inserting I am getting below error

"The data conversion for the column returned a status value 4 and status text as Text was truncated or one or more characters had no match in the target code page"

The column data type is DT_STR in derived column

The special character ¦ is causing this problem. This character when rentered is treated as 2 characters as Ħ. The column size defined is 10 and when this character is present it breaks it as 11 and we get that error above.

Changing the out put column length to 11 will solve this issue. Will this break while inserting the entry to table as table column size is 10.

But i feel like this is not a better solution approach as in future if the source file has 2 broken pipe symbols as compared to 1 now.At that time the size again will have to be changed

Screen shot of error thrown in flat file

3
  • I suggest you identify the character code in something like Notepad++ then run a find and replace beforehand with something like FNR.exe
    – Nick.Mc
    Mar 21, 2018 at 12:26
  • @Nick.McDermaid: Thanks for the suggestion. But in my case the pacake is combined and it is not advisable to touch the data as it is sensitive. Mar 21, 2018 at 12:41
  • I don't understand " the pacake is combined and it is not advisable to touch the data as it is sensitive". Either fix the file before it is imported, or use a derived column transformation in your SSIS package
    – Nick.Mc
    Mar 23, 2018 at 3:23

1 Answer 1

1

I was able to recreate the error.

I changed the output column to data type : DT_TEXT under advance editor in flat file source.

Hope it helps

5
  • even if i make this change when i re-open it is reverted back to old data type of DT_STR Mar 14, 2018 at 11:48
  • Also to add DT_TEXT is something that will not allow to do string operation. I specifically wanted to do some string operation using derived column n these Mar 14, 2018 at 12:21
  • I got the rason why it is failing. The symbol ¦ is been treated as 2 characters while reading. The column size is defind as 10. But now with this character total characters turn out to be 11 and it violates and breaks. What would be a better approach to avoid this Mar 15, 2018 at 10:50
  • The question is: where is the spec for 10 characters from? Why not make it 100 characters and be done with it?
    – Nick.Mc
    Mar 15, 2018 at 12:32
  • @Nick.McDermaid; The column for this table allows only 10 characters. This is a special case when this character was added and it comes from a 3rd party. Size of the table column can not be changed Mar 21, 2018 at 10:12

Your Answer

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

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