Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSIS Truncate Warning when moving data from a string max length 50 to a string max length 20

Noob SSIS question please. I am working on a simple database conversion script. The original data source have the phone number saved as a string with len = 50 in a column called Phone1. The destination table has the telephone number saved as a string with len = 20 in a column called Telephone. I keep getting this warning:

[110]] Warning: Truncation may occur due to inserting data from data flow column "Phone1" with a length of 50 to database column "Telephone" with a length of 20.

I have tried a few things including adding a Derived Column task to Cast the Phone1 into a DT_WSTR string with length = 20 - (DT_WSTR, 20) (SubString(Phone1, 1, 20)) and adding a DataConversion tasks to convert the field Phone1 from WT_WSTR(50) into WT_WSTR(20) but none of them work. I know I can SubStr phone1 in the SQL String @ the OLEDB Source but I would love to find out how SSIS deals with this scenario

like image 609
theUnderdog Avatar asked Feb 15 '23 02:02

theUnderdog


2 Answers

Root cause - This warning message appears over the SSIS data flow task when the datatype length of the source column is more than the datatype length of the destination column.

Resolution - In order to remove this warning message from SSIS solution, make sure datatype length of the source column should be equal to the datatype length of the destination column.

like image 106
Rav Avatar answered Feb 16 '23 18:02

Rav


Warning: Truncation may occur due to inserting data from data flow column "Phone1" with a length of 50 to database column "Telephone" with a length of 20.

Solution :

To remove the warning mentioned above, you may follow the below steps:

1)Right click on source components (for ex: flat file) and click on show advance editor.

enter image description here

2)Go to input and output properties.

3)Click on flat file source Output -->Output column --> select (PhoneNo)

4)You may get the properties window for phoneno click on Length property and change the value to 20. Click to Ok.

enter image description here

I wish this may help you.

like image 44
Dev singh Avatar answered Feb 16 '23 18:02

Dev singh