FIX: Error 16934 If Sp_cursor Update on Sproc After Dump/Load

ID: Q164056


The information in this article applies to:

BUG #: 16515 (6.5)

SYMPTOMS

You may receive the following error 16934 when performing an optimistic lookup:

Optimistic concurrency check failed, the row was modified outside of this cursor.

This problem may occur if you do all of the following:
This problem does not occur if the database is dumped and loaded back to the same database.


WORKAROUND

After the dump and load to a different database, drop and re-create the stored procedure on which the cursor is declared.


STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.


MORE INFORMATION

Error message 16934 is not intrinsically wrong. It merely indicates that during a cursor read, browse, or update operation, the optimistic lookup detected a changed row. However, in this particular case, error 16934 is wrong because no update to the underlying row took place.

SQL Server supports two different server-side cursor interfaces. One is ANSI SQL cursors, exposed through Transact-SQL statements such as DECLARE, FETCH, and so on. There is also an extended cursor interface that is accessed by means of the DB-Library and ODBC APIs. The sp_cursor extended cursor statements are emitted by the DB-Library or ODBC layers in response to certain DB-Library or ODBC API calls. Higher-level interfaces such as Remote Data Objects (RDO) often encapsulate these API-level calls, so you would need to run a trace utility such as SQL Trace to verify the sp_cursor call being made.

For more information on cursors and concurrency modes, see the on-line documentation and the following article in the Microsoft Knowledge Base:

Q156489 : Overview of SQL Server, ODBC, and DB-Library Cursors


Keywords          : kbusage SSrvDB_Lib SSrvGen SSrvTran_SQL kbbug6.50 
Version           : 6.5
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: April 8, 1999