Faiz
Faiz

Reputation: 283

Data export from SQL Server to csv error "data conversion returned status value 4"

I am trying to export data from sql to a csv file using ssis. In the data flow task my source is OLE DB and then a data conversion for the column that its failing on set to data length 500 and in then the flat file destination. In the flat file connection settings I made sure the data length is set at 500.

Still getting the error:

[Flat File Destination [12]] Error: Data conversion failed. The data conversion for column "description" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

NOTE: SSIS set the data length at 450 by recognition and that was the initial fail before I made the change of data length to 500./

Upvotes: 1

Views: 3388

Answers (2)

V Jo
V Jo

Reputation: 391

In my case, there was problem with some special character in data. It worked fine after checking "Unicode" checkbox in Flat file connection manager.

enter image description here

Upvotes: 2

Joe C
Joe C

Reputation: 3993

It sounds like you have some special characters in your data. Try a different code page in your flat file connection manager. You can try changing it to 65001 UTF-8

Similar article:

SSIS - Text was truncated or one or more characters had no match in the target code page - Special Characters

Upvotes: 3

Related Questions