Solved

SQL Server 2014 export error

Posted on 2016-08-22
5
56 Views
Last Modified: 2016-08-22
Hi There,

I'm trying to export a table in my database to a flat file. One of the columns is type nvarchar (200) and that's the column that the export job is having trouble with.

thanks in advance for your help!

Here's the error message:

- Copying to C:\BEST_FILES\tbDisc.txt (Error)
Messages
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "nvc_Album" 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 "nvc_Album".
 (SQL Server Import and Export Wizard)
 
Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Destination - tbDisc_txt" (43) failed with error code 0xC02020A0 while processing input "Flat File Destination Input" (44). 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)
0
Comment
Question by:forcedexposure
  • 3
  • 2
5 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 41766021
<knee-jerk reaction>

In the SSIS designer locate the flat file connection and double-click on it  The Connection Manager will display.
Choose Advanced on the left side
Locate column nvc_Album and click on it
The DataType property should be Unicode string [DT_WSTR], and the OutputColumnWidth should be 200.
1
 
LVL 65

Expert Comment

by:Jim Horn
ID: 41766030
>Text was truncated or one or more characters had no match in the target code page.".
Another issue may be the column values that are mapped to this column are more than 200 characters, which means you'll have to either increase the OutputColumnWidth number to accommodate the largest value, or cut off the values at 200 characters using something like LEFT(nvc_Album, 200).
0
 

Author Comment

by:forcedexposure
ID: 41766042
Thanks Jim! Actually, I'm using the SQL Server Import and Export Wizard for a one-time export.
I clicked on the "edit mappings..." button and see that the type is set to DT_WSTR and the column size is set to 200. So, following your suggestion here, i went back to the connection window and selected "UNICODE" for the output. that seems to have worked! thank you!!!
0
 

Author Closing Comment

by:forcedexposure
ID: 41766043
thanks for your help!
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 41766046
Thanks for the accept, good luck with your project.  -Jim

By an amazing coincidence I'm currently working an SSIS package that takes travel agent data from all over Europe and validating/loading into a data warehouse, so I'm dealing with unicode issues in SSIS right now.
1

Featured Post

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now