Solved

SQL Server 2014 export error

Posted on 2016-08-22
5
75 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

685 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