• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 36717
  • Last Modified:

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)

0
dba123
Asked:
dba123
  • 2
  • 2
  • 2
  • +1
2 Solutions
 
Brian CroweDatabase AdministratorCommented:
you either need to CAST or set your destination fields to nvarchar
0
 
SireesCommented:
String conversion errors can be resolved by changing char columns to nchar and varchar columns to nvarchar in SQL2005.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
dba123Author Commented:
as soon as I changd from varchar to nvarchar in my sql table it was fine!
0
 
dba123Author Commented:
I mean nchar....
0
 
Brian CroweDatabase AdministratorCommented:
wow...i wish i had suggested something like that
0
 
bruceshiningCommented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now