Microsoft Fixes SET IDENTITY_INSERT ON Statement Error

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

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish