Link to home
Start Free TrialLog in
Avatar of dba123
dba123

asked on

Cannot convert between unicode and non-unicode string data types (SSIS 2005)

I have an Excel Source component hooked to an OLE DB Destination component in my SSIS 2005 Data Flow Task.  After I mapped the excel columns to the OLE DB table columns i get these errors below.  I noticed that for the first error, the Excel Field format (when you mouse over the column name in the mappings section in OLE DB component) is of type [DTWSTR] and the corresponding SQL field from my SQL table that it's mapping to is of type [DT_STR] when mousing over that field in the mappings in the properties of my OLE DB component.  All table fields in SQL Server for the table I'm inserting into are of type varchar

TITLE: Package Validation Error
------------------------------

Package Validation Error

------------------------------
ADDITIONAL INFORMATION:

Error at Data Flow Task [OLE DB Destination [27]]: Columns "Commission Agency" and "CommissionAgency" cannot convert between unicode and non-unicode string data types.

Error at Data Flow Task [OLE DB Destination [27]]: Column "Product" cannot convert between unicode and non-unicode string data types.

Error at Data Flow Task [OLE DB Destination [27]]: Columns "Officer Code" and "OfficerCode" cannot convert between unicode and non-unicode string data types.

Error at Data Flow Task [OLE DB Destination [27]]: Columns "Agency Name" and "AgencyName" cannot convert between unicode and non-unicode string data types.

Error at Data Flow Task [OLE DB Destination [27]]: Columns "Agency Id" and "AgencyID" cannot convert between unicode and non-unicode string data types.

Error at Data Flow Task [OLE DB Destination [27]]: Columns "Tran Code" and "TranCode" cannot convert between unicode and non-unicode string data types.

Error at Data Flow Task [OLE DB Destination [27]]: Columns "User Id" and "UserID" cannot convert between unicode and non-unicode string data types.

Error at Data Flow Task [OLE DB Destination [27]]: Columns "Acct Number" and "AccountNumber" cannot convert between unicode and non-unicode string data types.

Error at Data Flow Task [DTS.Pipeline]: "component "OLE DB Destination" (27)" failed validation and returned validation status "VS_ISBROKEN".

Error at Data Flow Task [DTS.Pipeline]: One or more component failed validation.

Error at Data Flow Task: There were errors during task validation.

 (Microsoft.DataTransformationServices.VsIntegration)

Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

you either need to CAST or set your destination fields to nvarchar
SOLUTION
Avatar of Sirees
Sirees

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dba123
dba123

ASKER

as soon as I changd from varchar to nvarchar in my sql table it was fine!
Avatar of dba123

ASKER

I mean nchar....
wow...i wish i had suggested something like that
Conversion to nvarchar is not the only way.  The problem I was having is that converting to DT_STR was failing (as red unaccepted text)... until I converted it with as cast like:  (DT_STR, 50, 1292).
After doing the cast my data migrated to a varchar column just fine.