?
Solved

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

Posted on 2006-04-06
7
Medium Priority
?
36,597 Views
Last Modified: 2011-08-18
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
Comment
Question by:dba123
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 16392926
you either need to CAST or set your destination fields to nvarchar
0
 
LVL 20

Assisted Solution

by:Sirees
Sirees earned 2000 total points
ID: 16392936
0
 
LVL 20

Accepted Solution

by:
Sirees earned 2000 total points
ID: 16392942
String conversion errors can be resolved by changing char columns to nchar and varchar columns to nvarchar in SQL2005.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:dba123
ID: 16394498
as soon as I changd from varchar to nvarchar in my sql table it was fine!
0
 
LVL 1

Author Comment

by:dba123
ID: 16394502
I mean nchar....
0
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 16395145
wow...i wish i had suggested something like that
0
 

Expert Comment

by:bruceshining
ID: 22239522
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

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question