导入数据向导不喜欢我为列选择的数据类型 [英] Import Data Wizard Does Not Like Data Type I Choose For A Column

查看:31
本文介绍了导入数据向导不喜欢我为列选择的数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有其他人遇到同样的问题,当您从 Excel 文件导入数据到 MSSQL Server 2005 时,如果某些列主要包含数字数据,但即使您将列类型设置为 varchar,向导也无法导入那些字段无法解析为数字?

Does anybody else have this same problem, when you import data from Excel file to MSSQL Server 2005, if some column contains mostly numeric data, but even if you set the column type to varchar, the wizard fails to import those fields that fail to parse as numbers?

推荐答案

试试这个(注意:这些说明基于 Excel 2007)...

Try this (Note: These instructions are based on Excel 2007)...

以下步骤应强制 Excel 将列视为文本:

The following steps should force Excel to treat the column as text:

使用 Excel 打开电子表格.

Open your spreadsheet with Excel.

点击列标题,选择包含主要是数字数据"的整列.

Select the whole column that contains your "mostly numeric data" by clicking on the column header.

单击功能区菜单上的数据"选项卡.

Click on the Data tab on the ribbon menu.

选择文本到列.这将打开将文本转换为列向导.

Select Text to Columns. This will bring up the Convert Text to Columns Wizard.

-在第 1 步:点击下一步

-On Step 1: Click Next

-在第 2 步:点击下一步

-On Step 2: Click Next

-在第 3 步:选择文本并单击完成

-On Step 3: Select Text and click Finish

保存您的 Excel 工作表.

Save your Excel sheet.

使用 SQL Server 2005 导入数据向导重试导入.

Retry the import using the SQL Server 2005 Import Data Wizard.

这篇关于导入数据向导不喜欢我为列选择的数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆