Article ID: 253157 - Last Review: April 29, 2005 - Revision: 4.1 BUG: Identity field remains read-only after executing SET IDENTITY_INSERT ON statement
This article was previously published under Q253157 On This PageSYMPTOMS
Identity columns are normally read-only because the server generates the values. However, when you migrate data from one table to another you often want to keep the existing Identity column values rather than use server-generated values. Microsoft SQL Server 7.0 allows you to do this with the SET IDENTITY_INSERT ON statement. This operates correctly when you use INSERT INTO SQL statements. However, when you insert records through the AddNew method of an ActiveX Data Objects (ADO) Recordset, you receive the following error:
Run-time error '-2147217887 (80040e21)' Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. CAUSE
The Microsoft SQL Server 7.0 OLE DB provider incorrectly reports to ADO that the Identity column is read-only.
RESOLUTION
Use INSERT INTO SQL statements to add records where you must supply a value for Identity columns.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section. MORE INFORMATIONSteps to reproduce the behaviorUse the following steps to reproduce this behavior:
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
