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

前端 未结 6 1061
暗喜
暗喜 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条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-03 06:24

    There is a workaround.

    1. Import excel sheet with numbers as float (default).
    2. After importing, Goto Table-Design
    3. Change DataType of the column from Float to Int or Bigint
    4. Save Changes
    5. Change DataType of the column from Bigint to any Text Type (Varchar, nvarchar, text, ntext etc)
    6. Save Changes.

    That's it.

提交回复
热议问题