Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a flat file which I am importing into a SQL Server table using a SSIS package. The code page is set to 65001.

However, when I run a

SELECT * FROM tableName

the data appears mangled. For some reason it is not being stored in Unicode. The column is nvarchar, so that should not be an issue.

Also, if I insert data manually, the data is stored as expected.

What could be going wrong?

share|improve this question
add comment

2 Answers

And to get your columns to DT_WSTR as liam.confrey mentions, you will want to click on your flat file connection manager and redefine each column type from string [DT_STR] to Unicode string [DT_WSTR]

Do note that if you misclick like I usually manage to do and select something like 'two-byte unsigned integer [DTUI2]', classic off by one, the OutputColumnWidth property will default to 50 once you reset to unicode strings. You will want to make the output width align with the input width (unless you have a reason for making it larger).

Do not try and mangle the flat file source in your data flow in the advanced editor settings to make things Unicode.

share|improve this answer
add comment

The columns in the connection manager that your datasource is using need to be defined as "Unicode String (DT_WSTR)".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.