SQL Server SSIS Data Conversion keeps switching back to Unicode

zy1mlcev  于 2023-04-10  发布在  其他
关注(0)|答案(2)|浏览(167)

In SSIS I am querying the Active Directory for a list of domain users. The results (according to SSIS) are of data type 'Unicode text stream [DT_NTEXT]'.

I am using the Data Conversion item from the SSIS Toolbox to translate all the field before inserting them into an SQL table. I can go in and give each field an Output Alias and an output 'Data Type of String [DT_STR]' (I tried in the default options window and in the Advanced Properties window). I click OK to save my settings, but the red X is still there saying it can't convert to Unicode and if I reopen the properties window all the Data Types are set back to Unicode.

Has anyone had this happen to them before?

sbdsn5lh

sbdsn5lh1#

Unicode and non-unicode are incompatible types for conversion. You need to use a derived column transformation to add a new column. Use a data conversion in the expression:

(DT_STR, 20, 1252)[MyUnicodeCol]
rkue9o1l

rkue9o1l2#

Unicode and non-unicode are incompatible types for conversion. We need to convert that particular column as DT_WSTR from DT_NTEXT using Data conversion and then again we have convert it as DT_STR from DT_WSTR.

Conversion from DT_NTEXT to DT_STR

相关问题