May 18, 2020 at 9:01 am
I am new to SSIS and try to make a simple SSIS package.
Import a text file to a SQL Server database table.
English content, OK, no problem.
Chinese content, FAILED.
Text file, 2 columns, NAME, AGE. 3 rows, copy & paste some Chinese content from web site, save the text file Encoding, I chose Unicode but not the default one: ANSI.
Destination, a SQL table with 2 columns: NAME, nvarhcar(50), age, int.
Visual Studio:
Source: Flat File Connection Manager, Locale: English (United States), click the Unicode check box.
Advanced: Column 0, DT_WSTR, Column 1, string (DT_STR)
However, my Data Flow Task in the Control Flow tab shows:
Column "Column 0" and "name" cannot convert between unicode and non-unicode string data types.
Can you help me?
How can I import a Chinese unicode text file into a SQL Server table's nvarchar column?
Do I really need conversion as my text file has been saved as unicode and SQL Server table uses nvarchar.
It is a very simple SSIS package but I don't know how to handle Chinese unicode.
May 18, 2020 at 12:12 pm
This was removed by the editor as SPAM
May 19, 2020 at 2:23 am
I added N'xxx' to every row of my text file, same error.
I got the error even in design mode.
Column "Column 0" and "name" cannot convert between unicode and non-unicode string data types.
My text file has already been saved as Unicode and my SQL table column is NVARCHAR(50), why I still need to do conversion?
May 19, 2020 at 12:02 pm
Sorry my answer was no good. I tried to edit it and now it's been marked as spam for some reason. If you posted a sample txt file it would probably help. SSIS is out of my area though, sorry again
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply