sql2015
sql2015

Reputation: 611

SSIS package SQL DB to a Excel Spreadsheet destination Unicode Error

I have a DB OLE Source going to an excel destination. I receive the following error

Error at Data Flow [Excel Destination [88]]: Column "X" cannot convert between unicode and non-unicode string data types.

I have added in a data conversion to change string columns to Unicode. this has not resolved the problem. any guidance would be appreciated

Upvotes: 1

Views: 562

Answers (2)

Hadi
Hadi

Reputation: 37313

Try using a derived column instead of data conversion transformation, use the following expression

If destination is unicode

(DT_WSTR,50)[X]

Else

(DR_STR,50,1252)[X]

Upvotes: 0

Prabhat G
Prabhat G

Reputation: 3029

Go to your excel destination component --> mapping --> hover your mouse over column in question, you'll see that it is Unicode Str. Something like this :

img

Hence, you need a data conversion component to add an alias of source column to DT_WSTR Unicode String AND map it in excel destination component.

img2

I replicated your problem and thus providing you solution.

IF this doesn't work, then delete these components and re-add them, as this is will mostly resolve your issue.

Upvotes: 0

Related Questions