错误8101只有在使用列列表且IDENTITY_INSERT为ON时,才能指定表中标识列的显式值 [英] Error 8101 An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON
本文介绍了错误8101只有在使用列列表且IDENTITY_INSERT为ON时,才能指定表中标识列的显式值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到以下错误,即使我在插入数据之前截断表格。
错误:错误8101标识的显式值表格中的列只能在使用列列表且IDENTITY_INSERT为ON时指定
以下是我正在使用的脚本。
TRUNCATE TABLE TableName
INSERT INTO TableName SELECT * FROM TableName
I am getting the below error even though i am truncating the table before inserting the data.
Error: Error 8101 An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON
Below is the script i am using.
TRUNCATE TABLE TableName
INSERT INTO TableName SELECT * FROM TableName
推荐答案
您好,
请看一下:
SQL SERVER - 修复:错误8101只有在使用列列表且IDENTITY_INSERT为ON时,才能指定表中标识列的显式值 [ ^ ]
已添加:
此外,您需要使用列列表插入行:
Hi,
Please take a look at this:
SQL SERVER – Fix : Error 8101 An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON[^]
Added:
Also, you need to insert your rows using a column list:
INSERT INTO TableName
(ColumnName(s))
SELECT ColumnName(s)
FROM TableName
这篇关于错误8101只有在使用列列表且IDENTITY_INSERT为ON时,才能指定表中标识列的显式值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文