PRB: Error Does Not Occur When Setting IDENTITY_INSERT ON For More Than One Table (250910)
The information in this article applies to:
- Microsoft SQL Server 7.0
- Microsoft SQL Server 7.0 Service Pack 1
This article was previously published under Q250910 SYMPTOMS If you use the SQL Server OLE DB provider (SQLOLEDB) and a
Server side cursor, SQL Server 7.0 should generate an error when you set the IDENTITY_INSERT property to ON for more than one table per session, but it does not. You may
still use SQLOLEDB with a Server side cursor as long as you are aware of the
potential erroneous behavior. The error message that should occur is:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
IDENTITY_INSERT is already ON for table 'pubs.dbo.table1'. Cannot perform SET
operation for table 'jobs'. SQL Server Books On-Line states the following:
At any time, only one table in a session can have the IDENTITY_INSERT property set to ON. If a table already has this property set to ON, and a SET IDENTITY_INSERTON statement is issued for another table, Microsoft® SQL ServerT
returns an error message that states SET IDENTITY_INSERT is already ON and reports the table it is set ON for. CAUSEMicrosoft
has confirmed that this is a problem in the Microsoft products that are listed
at the beginning of this article.
WORKAROUND Use the SQLOLEDB with a client side cursor if you need to
trap for the error condition. Also, the Microsoft OLEDB Provider for ODBC
(MSDASQL) correctly generates the error condition regardless of the cursor
location.
| Modification Type: | Major | Last Reviewed: | 6/24/2004 |
|---|
| Keywords: | kbprb KB250910 |
|---|
|