Why am I getting an error doing an insert when IDENTITY_INSERT
is set to OFF?
(当IDENTITY_INSERT
设置为OFF时,为什么我在插入时出错?)
How do I turn it on properly in SQL Server 2008?
(如何在SQL Server 2008中正确启用它?)
Is it by using SQL Server Management Studio? (是使用SQL Server Management Studio吗?)
I have run this query:
(我运行了这个查询:)
SET IDENTITY_INSERT Database. dbo. Baskets ON
Then I got the message back in the console that the Command(s) completed successfully.
(然后我在控制台中收到消息,命令已成功完成。)
However when I run the application, it still gives me the error shown below: (但是当我运行应用程序时,它仍然给出了如下所示的错误:)
Cannot insert explicit value for identity column in table 'Baskets' when
IDENTITY_INSERT is set to OFF.
ask by Beginner translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…