I am loading a cleaned CSV file into SSIS using a Flat File Source, but the Data Flow keeps failing with the following error:
Data conversion failed. The data conversion for column "LOC_STREET_TYPE" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page."
The full error message also includes:
The PrimeOutput method on Flat File Source returned error code 0xC0202092. Text was truncated or one or more characters had no match in the target code page.
What I have done so far:
Exported the CSV using Python with CRLF row endings and encoding latin1 / ANSI (code page 1252)
Set the Flat File Connection Manager to 1252 (ANSI – Latin I)
In the Advanced tab, I increased the
OutputColumnWidthforLOC_STREET_TYPEfrom the default to 100Opened the Flat File Source “Advanced Editor” and also updated the output column length for the same column
Clicked “Yes” when SSIS asked to sync metadata
Re-ran the package, but the error persists at different rows (line 136, line 137, etc.)
The column LOC_STREET_TYPE contains short string values such as: ST, AV, BLVD, WAY, PKWY, DR
Nothing exceeds even 10 characters, so truncation should not happen.
However SSIS still reports truncation or code page mismatch.
csvmodule and acsv_writerto generate your CSV files? Did you usequoting=csv.QUOTE_ALLor at leastQUOTE_MINIMAL?