当列数据类型是唯一标识符时如何导入Excel工作表数据 [英] How to import excel sheet data when column datatype is unique identifier

查看:206
本文介绍了当列数据类型是唯一标识符时如何导入Excel工作表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的excel工作表包含一些数据.

当我将Excel工作表导入数据库时​​,它显示出这样的错误

I have excel sheet contains some data.

When i importing the excel sheet to database it shows error like this

Column name or number of supplied values does not match table definition.



因为我将列名"id"设置为身份规范"yes",并且其数据类型在数据库表中为唯一标识符" ...所以我得到了这些错误....


解决此问题的解决方案是什么?...

谁能帮我......

问候
Vivek



because i have column name "id" set as identity specification "yes" and its datatype is "unique identifier" in database table....So I got these error....


What is the solution to recover this problem....

Can anyone help me....

Regards
Vivek

推荐答案

将选项标识插入设置为ON ...
Set the option identity insert ON...


您必须为UniqueIdentifier字段提供一个值.如果这是一次性的事情,则可能要删除该列,进行导入,然后再添加回去.或者,您可以在Excel文件中生成值并将其导入.或者只是删除标识并允许为null,然后再将其设置回.
You have to provide a value for the UniqueIdentifier field. If this is a one time thing you may want to remove the column, do the import, and add it back. Or you can generate values in the Excel file and import them in. Or just take off the identity and allow null and then set it back.


您可以在Excel文件中生成随机ID.或摆脱身份.根据我的经验,我会选择第一个,特别是与Costom互动.但是您最好将生成的ID反馈给他们.
You can either generate random ID in the Excel file or get rid of the identity. From my experience, I would choose the first one, especially interact with the costoms. But you d better to feed back the generated ID to them.


这篇关于当列数据类型是唯一标识符时如何导入Excel工作表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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