Archive for September 17th, 2010

SQL Server Export : “Text was truncated or one or more characters had no match in the target code page”

I recently did an export from a database table on a thirds party website we host, from the news letter table- Using the standard SQL Export dialogue in sql server management studio 2008, i selected to export to a flat file- i pasted in my query and adjusted the column mappings then hit finish only to be confronted with an error mid way through the export;

Copying to C:\Users\Shaw.Young\Desktop\bq-newsletters1.txt (Error)
Messages
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column “surname” 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)

Error 0xc02020a0: Data Flow Task 1: Cannot copy or convert flat file data for column “surname”.
(SQL Server Import and Export Wizard)

Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component “Destination – bq-newsletters1_txt” (46) failed with error code 0xC02020A0 while processing input “Flat File Destination Input” (47). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)

Error 0xc02020c4: Data Flow Task 1: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
(SQL Server Import and Export Wizard)

Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component “Source – Query” (1) returned error code 0xC02020C4.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)

Export - Choose Destinatino Dialogue

Export - Choose Destinatino Dialogue

I checked the mapping for the surname field, and at 100 characters it was the same as the field length so this wasn’t truncating, which left me with the codepage issue.  This is easily fixed by simply changing the encoding of the flat file all the way back on the Choose a Destination tab- Mine defaulted to “1252 (ANSI – Latin I)” so i changed it to “65001 (UTF – 8)” and this fixed the problem.  Really simple, but I’d actually never come across this before when doing an export so figured I would blog it.

6 Comments

I absolutely love these. They came at the lace wigs are good quality, and very soft. Absolutely love these extensions. I just love this hair. Hair came on time, I waited until after hair extensions uk very full, no shedding and it is been installed for 3 weeks now and yes I jus ordered 3 more bundles. Lol. I definitely recommend this company for your bundles ladies. They are soft, hair bundles on the head for human hair wigs and I would continue to recommend them. I have thinner hair so they cover and blend nicely.