Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSIS Flat-file source - Text was truncated or one or more characters had no match in the target code page

Tags:

ssis

I'm trying to import records into an SQL database file from a comma-delimited flat file and I get a "Text was truncated or one or more characters had no match in the target code page." when the source file has more than 50 characters in a particular field. The Destination file target for that field is 1000 characters, so that shouldn't be an issue. I narrowed it down to "A123456789B123456789C123456789D123456789E123456789" in the text file did import while "A123456789B123456789C123456789D123456789E123456789F" threw the error.

How can I get it to allow more characters before truncating?

like image 571
Dan Norton Avatar asked Dec 26 '22 22:12

Dan Norton


1 Answers

I found the answer in the second answer to: Importing CSV file into SQL server... Thanks to Eoan for that.

Ultimately, in the Advanced Editor of the source datafile, on the Input and Output Properties tab, under External Columns, there is a Length property that defaults to 50. Changing that to match the Target Database File did the trick.

like image 52
Dan Norton Avatar answered Apr 18 '23 06:04

Dan Norton