SSIS Excel Import Forcing Incorrect Column Type

后端 未结 16 1361
醉梦人生
醉梦人生 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:30

    It took me a bit to realize the source of the error in my package. Ultimately I found that data was converted to null (Example: from "06" to "NULL"), and I found this via Preview in the source file connection (Excel Source> Edit> Connection Manager> Sheet='MySheet'> Preview...). I got excited when I read the post by James to edit the connection string to have extended properties: ;Extended Properties="IMEX=1". But that did not work for me.

    I was able to resolve the error by changing the Cell Format in Excel worksheet from “Number” to “Text”. After changing the format, the upload process ran successfully! My connection string looks like: Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\myServer\d$\Folder1\Folder2\myFile.xlsx;Extended Properties="EXCEL 12.0 XML;HDR=NO";

    Here is are some screenshots that resolved my error message.

    Error: Metadata of Excel file connection

    Source of error: “General” format

    Source of error changed: “Text” format

    Error fixed: Metadata of Excel file connection

提交回复
热议问题