Error converting data types when importing from Excel to SQL Server 2008

前端 未结 6 1065
暗喜
暗喜 2020-12-03 06:00

Every time that I try to import an Excel file into SQL Server I\'m getting a particular error. When I try to edit the mappings the default value for all numerical fields is

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 06:46

    There seems to be a really easy solution when dealing with data type issues.

    Basically, at the end of Excel connection string, add ;IMEX=1;"

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\YOURSERVER\shared\Client Projects\FOLDER\Data\FILE.xls;Extended Properties="EXCEL 8.0;HDR=YES;IMEX=1";
    

    This will resolve data type issues such as columns where values are mixed with text and numbers.

    To get to connection property, right click on Excel connection manager below control flow and hit properties. It'll be to the right under solution explorer. Hope that helps.

提交回复
热议问题