我收到错误消息如何解决此问题 [英] I Got Error Message How to resolve this

查看:77
本文介绍了我收到错误消息如何解决此问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

插入/更新错误:当IDENTITY_INSERT设置为OFF时,无法为表客户"中的标识列插入显式值.

Insert/Update Error:Cannot insert explicit value for identity column in table ''Customers'' when IDENTITY_INSERT is set to OFF.

推荐答案

设置IDENTITY_INSERT Customers表的主要/身份"列中的"ON".

请查看下面的链接以获取更多信息.
http://msdn.microsoft.com/en-us/library/ms188059.aspx
Set IDENTITY_INSERT to ON for Primary/Identity Column of your Customers Table.

Have a look at below link for more information.
http://msdn.microsoft.com/en-us/library/ms188059.aspx




请检查客户"表中的身份列.如果它是自动增量列,则在插入/更新客户"表时不应传递值.

喜欢

插入客户(id,name)值(1,''amit'');

如果"id"列是标识和自动递增,则应在下面的查询中使用.

将值插入客户(名称)values(''amit'');

谢谢
-amit.
Hi,

please check identity columns in ''Customer'' table. if it is autoincrement column, you should not pass value when inserting/updating ''Customer'' table.

like

insert into customer(id,name)values(1,''amit'');

if ''id'' column is identity and autoincrement you should use below query.

insert into customer(name)values(''amit'');

thanks
-amit.


您会收到此错误,因为将ID键设置为自动递增后,您就无需手动为该字段输入值了.

如果通过SQl Server Management在数据库中输入数据,则将一次又一次出现该错误.

SQL Server将管理该字段的插入.

希望对您有所帮助:)
You are getting this error because once have the ID key set as auto-increment you don''t need to bother to enter manually a value for that field.

If you enter data in your database through SQl Server Management you will get that error again and again.

SQL server will manage the insertion of that field.

hope it helps :)


这篇关于我收到错误消息如何解决此问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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