I m trying to import file from Excel
into an SQL table
. When i convert from unicode string[DT_WSTR]
to string[DT_STR]
with data conversion i get a truncation error on some columns. This is output error:
[Data Conversion [2]] Error: Data conversion failed while converting column "Contact Name" (187) to column "DataContactName" (105). The conversion returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
So data flow finish as failure, but some rows are copied to sql table
.
Is there some workaround or what is solution to this?
Here's what you can do
Failure on error
to Ignore on error
. Though you should definitely output the error and log to a flat file for checking the data lost.On your comment :
I added ignore truncation errors in error output and all rows were copied in sql table. There was no problem to convert characters like ; or "á". Can u brief me what kind of errors i ignored?
I suggest that you use a Multi-cast transformation on the error output after changing the failure setting to from Ignore Failure
to Redirect Row
. Then insert one of the output from Multi-cast into SQL server and other on a flat file destination. This way you'll get data into SQL server as well in flat file to analyse the error