本文介绍了当IDENTITY_INSERT设置为OFF时,无法在表'tblcharge22'中为标识列插入显式值.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三栏.

当我这样传递查询时,它显示错误:
Cannot insert explicit value for identity column in table ''tblcharge22'' when IDENTITY_INSERT is set to OFF.
我试图将值(1,1,1)插入tbltt(srno,txn,ppt)

I have got three columns.

When I passed the query like this, it is showing the error:
Cannot insert explicit value for identity column in table ''tblcharge22'' when IDENTITY_INSERT is set to OFF.
I am trying to insert into tbltt(srno,txn,ppt) values (1,1,1)

推荐答案


SET IDENTITY_INSERT TableName  On
insert into TableName  Values(1,1,1)
SET IDENTITY_INSERT TableName  OFF



这篇关于当IDENTITY_INSERT设置为OFF时,无法在表'tblcharge22'中为标识列插入显式值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 08:04