Microsoft Fixes SET IDENTITY_INSERT ON Statement Error

Microsoft has released a hotfix for an error that you may receie when running a SET IDENTITY_INSERT ON statement on a table.

ITPro Today

December 22, 2004

1 Min Read
ITPro Today logo

Microsoft has released a hotfix for an error that you may receive when running a SET IDENTITY_INSERT ON statement on a table. In SQL Server 2000, when you run a SET IDENTITY_INSERT ON statement on a table, then try to run a query to insert a row into the table that contains an identity column, you might receive an error message that looks like: "Cannot insert explicit value for identity column in table 'TableName' when IDENTITY_INSERT is set to OFF." This problem occurs when the client-cached cursor query isn't invalidated and the query uses the prior setting of SET IDENTITY_INSERT OFF when it tries to insert the row. To find out more about this problem and the supported hotfix, read the Microsoft article "FIX: You may receive an error message when you run a SET IDENTITY_INSERT ON statement on a table and then try to insert a row into the table in SQL Server 2000" at

   http://support.microsoft.com/?kbid=878501

Read more about:

Microsoft
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like