2014-11-24 55 views
-2

當IDENTITY_INSERT設置爲OFF時,無法在表'Tbl_UserGroup'中爲標識列插入顯式值。無法插入顯式

我得到了錯誤信息:Cannot insert explicit保存時, 但使用sql命令行插入的值,問題只是使用窗體。 什麼是可能的解決方案?

+1

可能重複](http://stackoverflow.com/questions/1334012/cannot-insert-explicit-value-for-identity-column-in-table-table-when-identity) – 2014-11-24 17:29:50

回答

2

您需要設置identity insert ON如果你要explicitly將值插入標識列

SET IDENTITY_INSERT table ON 

--Insert statement 

SET IDENTITY_INSERT table OFF 
的[無法當IDENTITY \ _insert設置爲OFF身份列在表「表」插入顯式值
+0

請考慮投票關閉已經存在的問題在本網站上回答。 – 2014-11-24 17:30:21