Sometime while importing the data from Text file to SQL Server 2005 table we keep getting the below error and the same data can be imported to SQL Server 2000 without any issue.
"Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "FRDNAME" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".(SQL Server Import and Export Wizard)"
Initially i was also convinced that this is definitly a bug in SQL Server 2005. But i was wrong. The reason why SQL gives this error is because Flat File defaults initially all the columns to Characters with length of 50.And if your data length in column is more than 50 you get this error.
The easy fix for this issue is.
While you select the text file as data source go to "Advanced" tab and Set the size of the column length to be according to what you want.
And you are all set.
Thursday, October 2, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment