4

I've a dataflow in SSIS 2008. It reads the data from flat file and inserts in to database.

The flat file is CSV. For some reason, all the fields in flat file connection manager seems to have 50 OutPutColumnWidth.

Could someone please suggest how to fix it. I'm getting error below: Truncation may occur due to inserting data from data flow column

  • What is the wish in the flat file ? You can change the width in ssis. – Kin Shah Jan 13 '14 at 14:02
2

This warning message displays when any time source column data type length will be more than then length of destination datatype. To resolve the warning message check here -

1

Sounds like you have data in one of your columns that is longer than 50 characters. The default behavior of SSIS is to assign 50 to the width of the columns in an flat file source. You have to edit this manually or you could use the Suggest Types button to have SSIS sample your data and suggest appropriate data types.

Your error message should indicate which column is the issue. I would bump that width up in the connection manager definition to a larger variable and retry executing it. If you don't know what column it is, try using the Suggest Types button to have SSIS adjust its data types and lengths based on your data.

1

this is just a warning.your package will execute anyway. this comes up because the length of source variable and the destination variable is not same. to resolve this warning,right click the destination source,select show advance editor option,select the input and output properties tab,expand the input and output variable and check the length.if they are different then make it same using the data conversion operation.

0

I solved the truncation fiasco by Casting every output field first in my stored procedure, then continue with my code. This way I have full control and know my lengths. Then I can match them in my SSIS references.

IF 1 = 0
BEGIN
SELECT  CAST(NULL AS varchar(50)) AS InsurancePlan,
        CAST(NULL AS varchar(50)) AS PolicyNumber,
        CAST(NULL AS date)        AS ServiceDate
END
-------------------------------------------------------
BEGIN
SELECT .....
0

If all else fails try this.

What I've experienced is that this error shows up occasionally after I've copied and pasted existing Ole DB Destination/Source element either from the same Data Flow Task or a Data Flow Task from another package and then start changing the details within.

Even when the Data Type and Length of the columns identical, this warning still appears on occasion. This is when I delete the copied element(s) and build them from scratch. This has made the warning disappear.

My guess is that the metadata is fouled up during the copy/paste.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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