我该如何解决"对于表&QUOT的标识列显式值;? [英] How can i solve "An explicit value for the identity column in table"?

查看:145
本文介绍了我该如何解决"对于表&QUOT的标识列显式值;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

,如果我尝试了一些数据添加到我的表发生错误:

错误:消息8101,级别16,状态1,行1 当列列表用于表'ENG_ preP'的标识列一个明确的价值只能被指定和IDENTITY_INSERT为ON。

 插入ENG_ $ P $的pP VALUES('572012-01-1,572012-01-2,572012-01-3,572013-01-1,572013-01- 2',
'',
'500',
'',
A320 P.001-A',
去除LH翼安全绳,
'',
'',
'',
0,
'',
AF,
'12 -00-00-081-001',
'',
'',
'',
'',
'',
'',
'')
 

解决方案

如果你必须写的标识列,使用

  SET IDENTITY_INSERT YourTableName ON
 

正如错误信息提示。

否则,不要试图写入标识列。

if i try to add some data into my table error occurs:

Error:Msg 8101, Level 16, State 1, Line 1 An explicit value for the identity column in table 'ENG_PREP' can only be specified when a column list is used and IDENTITY_INSERT is ON.

insert into ENG_PREP VALUES('572012-01-1,572012-01-2,572012-01-3,572013-01-1,572013-01-2',
'',
'500',
'',
'A320 P.001-A',
'Removal of the LH Wing Safety Rope',
'',
'',
'',
'0',
'',
'AF',
'12-00-00-081-001',
'',
'',
'',
'',
'',
'',
'' )

解决方案

If you must write to the identity column, use

SET IDENTITY_INSERT YourTableName ON

just as the error message suggests.

Otherwise, don't try to write to the identity column.

这篇关于我该如何解决"对于表&QUOT的标识列显式值;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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