SQLTeam.com | Weblogs | Forums

SSIS Error: Cannot convert between unicode and non-unicode string data types

Hi experts,
The package reads a table and inserts to excel.
The column LastName is defined as varchar(50)

In the SQL Command, I do a CAST for the LastName column as shown here:
CAST(Users.LastName as nvarchar(50)) as [LastName]
I also set the Database connection setting for "Delay Validation" to TRUE
So why am I still getting this error?

[Excel Destination [2]] Error: Column "LastName" cannot convert between unicode and non-unicode string data types.

Thanks

SSIS has some troubles with changing a datatype. Sometimes it helps to uncheck LastName and save it and then adding it again. Once it was solved by simple restarting Visual Studio.

Solving an SSIS Error – Cannot convert between Unicode and non-Unicode – SQLServerCentral

1 Like

Thanks, @RogierPronk. With your tips I was able to get it working correctly.