Question

I have an odd problem. I need to export Japanese characters from a table to a raw text file. When I run the select statement in SQL, I am able to see the characters displayed correctly. However, when I run the SSIS package to export these values to a text file they are displayed as ?'s.

Data type of the field is NTEXT. Has anyone ran into this problem before?

SQL statement:

select cast(body as nvarchar(max)) as body from msgsMarket

In SSIS package's flat file connection manager, I have set the output encoding to use 932

Was it helpful?

Solution

This is not a solution but might probably help you to identify the problem in your case.

Created a sample SSIS package using SSIS 2008 R2 with UTF-8 and Unicode encodings and the SQL Server data exported correctly to flat files.

Sample SQL data in the file. Description field was of data type NVARCHAR. The sample was also tried by changing the data type of the Description field to NTEXT and the flat files still exported correctly.

Sample SQL data

SSIS package was created with a data flow task with two outputs for UTF-8 and Unicode.

Data flow task

First flat file connection manager to generate flat file with encoding UTF-8.

UTF-8 encoding

Output file generated with UTF-8 encoding.

UTF-8 output file

Second flat file connection manager to generate flat file with encoding Unicode.

Unicode encoding

Output file generated with Unicode encoding.

Unicode output file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top