Truncation may occur due to inserting data

Mike Harris 1 Reputation point
2020-09-10T02:40:09.937+00:00

I recently changed the flat file source in the data flow task. Following that change, I am noticing below error for most of the columns and SSIS package no longer executes. Can someone please let me know what might be going wrong?

Also I see these messages in the job history: Description: Truncation may occur due to inserting data from data flow column "HomePhone" with a length of 50 to database column "HOMEPHONE" with a length of 15.

Thanks.23585-warningcapture.jpg

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,486 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Monalv-MSFT 5,896 Reputation points
    2020-09-10T06:09:33.03+00:00

    Hi @Mike Harris ,

    1.Please add length of column "HomePhone" using the following sql query in SSMS:
    ALTER TABLE [TableName] ALTER COLUMN [ColumnName] VARCHAR (50);
    23588-altercolumndatatype.png

    2.Or create new table with the length of cloumn "HomePhone" as 50.
    23703-createnewtable.png

    Best Regards,
    Mona


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Jeffrey Williams 1,891 Reputation points
    2020-09-15T21:51:04.02+00:00

    When you changed the connection manager - it defaulted to string 50 for all columns. You need to go into the connection manager - the advanced page and change the data type and length of every column to match the columns in the table.

    If there are a lot of columns - you could create a new connection manager as a source from the database table. Once created it should have all of the fields and correct data types. You can then delete the source in the data flow leaving the connection manager and use that connection manager as the source from the file. You may need to move things around if the column order isn't the same.

    1 person found this answer helpful.
    0 comments No comments