SSIS Error : 'Cannnot convert between unicode and non-unicode string data types' + Solution

SSIS Package : While Extracting Sharepoint Lookup column, getting error

working on one project and there is need to extract Sharepoint list data and import them to SQL Server table. I have few lookup columns in the list.

Steps in my Data Flow :
  1. Sharepoint List Source
  2. Derived Column
its formula : SUBSTRING([BusinessUnit],FINDSTRING([BusinessUnit],"#",1)+1,LEN([BusinessUnit])-FINDSTRING([BusinessUnit],"#",1))
  1. Data Conversion
  2. OLE DB Destination
But I am getting the error of not converting between unicode and non-unicode string data types.


Solution : 

You have a data conversion transformation.  Now, in the destination are you assigning the results of the derived column transformation or the data conversion transformation.  To avoid this error you need use the data conversion output.
You can eliminate the need for the data conversion with the following in the derived column (creating a new column):

(DT_STR,100,1252)(SUBSTRING([BusinessUnit],FINDSTRING([BusinessUnit],"#",1)+1,LEN([BusinessUnit])-FINDSTRING([BusinessUnit],"#",1)))

The 100 is the length and 1252 is the code page (I almost always use 1252) for interpreting the string.

Comments

Popular posts from this blog

SSAS : A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running. (Microsoft.AnalysisServices.AdomdClient). + Solution

SSIS Error : Unable to infer the XSD from the XML file. The XML contains multiple namespaces