Import Package Error - Cannot Convert between Unicode and Non Unicode String Data Type

前端 未结 16 606
小蘑菇
小蘑菇 2021-01-31 13:29

I have made a dtsx package on my computer using SQL Server 2008. It imports data from a semicolon delimited csv file into a table where all of the field types are NVARCHAR MAX.

相关标签:
16条回答
  • 2021-01-31 14:20

    If anyone is still experiencing this issue, I found that it related to a difference in Oracle Client versions.

    I have posted my full experience and solution here: https://stackoverflow.com/a/43806765/923177

    0 讨论(0)
  • 2021-01-31 14:23

    The problem of converting from any non-unicode source to a unicode SQL Server table can be solved by:

    • add a Data Conversion transformation step to your Data Flow
    • open the Data Conversion and select Unicode for each data type that applies
    • take note of the Output Alias of each applicable column (they are named Copy Of [original column name] by default)
    • now, in the Destination step, click on Mappings
    • change all of your input mappings to come from the aliased columns in the previous step (this is the step that is easily overlooked and will leave you wondering why you are still getting the same errors)
    0 讨论(0)
  • 2021-01-31 14:23

    The dts data Conversion task is time taking if there are 50 plus columns!Found a fix for this at the below link

    http://rdc.codeplex.com/releases/view/48420
    

    However, it does not seem to work for versions above 2008. So this is how i had to work around the problem

    *Open the .DTSX file on Notepad++. Choose language as XML
    *Goto the <DTS:FlatFileColumns> tag. Select all items within this tag
    *Find the string **DTS:DataType="129"**  replace with **DTS:DataType="130"**
    *Save the .DTSX file. 
    *Open the project again on Visual Studio BIDS
    *Double Click on the Source Task . You would get the message
    
    the metadata of the following output columns does not match the metadata of the external columns with which the output columns are associated:
    ...
    Do you want to replace the metadata of the output columns with the metadata of the external columns?
    
     *Now Click Yes. We are done !
    
    0 讨论(0)
  • 2021-01-31 14:26

    Mike, I had the same problem with SSIS in SQL Server 2005... Apparently, the DataFlowDestination object will always attempt to validate the data coming in, into Unicode. Go to that object, Advanced Editor, Component Properties pane, change the "ValidateExternalMetaData" property to False. Now, go to the Input and Output Properties pane, Destination Input, External Columns - set each column Data type and Length to match the database table it's going to. Now, when you close that editor, those column changes will be saved and not validated over, and it will work.

    0 讨论(0)
提交回复
热议问题