SSIS Excel Import Forcing Incorrect Column Type

后端 未结 16 1164
醉梦人生
醉梦人生 2020-11-30 01:06

I\'m trying to import a spreadsheet to our database using SSIS. For some reason SSIS wants to believe two of the columns are of type Double, when they contain character dat

相关标签:
16条回答
  • 2020-11-30 01:37

    I had the same problem. The problem sit in the Excel Source task. When you setup this task the first time, the task will connect to the specified Excel file (via the Excel connection) and decide what type each column is based on the current spreadsheet.

    Thus, if you set up the Excel Source task, just make sure that the columns that should be text only has text in the column. This means that the Excel Source task will always assume that any subsequent spreadsheets will have the same format and will read 12345 as text because the column was text when the task was set up.

    Hope it makes sense!

    0 讨论(0)
  • 2020-11-30 01:37

    This worked for me. Select the problematic column in Excel - highlight the whole column. Change the format to "Text". Save the Excel file.

    In your SSIS package, go to the Data Flow pane for your import. Double click the Excel Source node. It should warn you that the types have changed and ask you if you want to remap them. Click Yes. Executing should now work and bring in all values.

    Note: I'm using Excel 2013 and Visual Studio 2015, but I assume these instructions would work for earlier versions too.

    0 讨论(0)
  • 2020-11-30 01:39

    ;IMEX=1; is not always working... Everything about mixed datatypes in Excel: Mixed data types in Excel column

    enter image description here

    0 讨论(0)
  • 2020-11-30 01:42

    I've used the following recipe:

    1. Import data from Excel to Access
    2. Import data from Access to SQL Server

    and it worked for me...

    0 讨论(0)
  • 2020-11-30 01:44

    One thing that isn't mentioned in the accepted answer is that the "IMEX=1" parameter has to go inside the quoted portion of:

    ...;Extended Properties="...";
    
    0 讨论(0)
  • 2020-11-30 01:46

    You can also alter the registry to look at more values than just the first 8 rows. I have used this method and works quite well.

    http://support.microsoft.com/kb/281517

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