SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Data Flow Task gives Truncation may occur
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jbates99
Constraint Violating Yak Guru

376 Posts

Posted - 06/17/2013 :  20:42:11  Show Profile  Reply with Quote
Hi experts,

I have a problem that's making me crazy. This Data Flow has a Flat File source and an OLE DB table as the destination. The source text file has fixed width columns.

Validation warning. Data Flow Task: Truncation may occur due to inserting data from data flow column "RecordID" with a length of 255 to database column "RecType" with a length of 1.

Any ideas? Thanks, Jack

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/18/2013 :  00:42:09  Show Profile  Reply with Quote
the error message is obvious. Your SSIS package has a mapping between RecordID column from source which is of length 255 to RecType field which just has length of 1. This can be a potential cause for value truncation which is what SSIS complains about.


If source is a flat file it usually takes length as 255 by default for text data. So the solutions are
1. Add a derived column in between source and destination (flat file source and oledb table) and add an expression to take only first character. You should do this only if you're sure the source field will have only one character data always
2. Another way is to go to advanced properties of flat file and chage it as per your business rule (ie if you're certain it can contain only 1 character make it 1

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

jbates99
Constraint Violating Yak Guru

376 Posts

Posted - 06/18/2013 :  09:25:47  Show Profile  Reply with Quote
visakh16, thanks for your idea.

I wish it were so easy. I had already changed the Flat file Connection by setting the correct Input Column Width for each column. And the Preview window shos everything correctly, all columns. No columns are defined as length 255. I don't know why I'm getting
Validation warning. Data Flow Task: Truncation may occur due to inserting data from data flow column "RecordID" with a length of 255 to database column "RecType" with a length of 1.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/18/2013 :  10:13:36  Show Profile  Reply with Quote
then try the derived column method.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000