FIX: Cursor w/ Union May Cause Errors if Not First in BatchLast reviewed: May 2, 1997Article ID: Q138746 |
The information in this article applies to:
SYMPTOMSIf a cursor is opened that contains a union between two queries, you may receive errors such as:
DB-Library: Possible network error: Bad token from SQL Server: Datastream processing out of sync. Net-Library error 0: DB-Library: Possible network error: Bad token from SQL Server: Datastream processing out of sync. Connection broken. <above is repeated many times> Net-Library error 6: ConnectionClose (CloseHandle()). Msg 533, Level 20, State 4 Can't find a range table entry for range 5. DB-Library Process Dead - Connection BrokenAnd in some cases, the following message may also occur:
Msg 16942, Level 16, State 2 Asyncronous keyset generation failed, the cursor has been deallocated WORKAROUNDThis generally occurs when there are other Transact-SQL statements preceding the declaration of the cursor. Moving the cursor to the beginning of the batch may prevent the errors from occurring.
STATUSMicrosoft has confirmed this to be a problem in SQL Server for Windows NT version 6.0. This problem was corrected in Service Pack 2 for SQL Server version 6.0. For more information, contact your primary support provider.
MORE INFORMATIONChanging the UNION to a UNION ALL can cause the problem seemingly to disappear. However, in some cases, the batch runs without any error in the errorlog or to the client, but the connection is broken and the dbproc is dead.
|
Additional query words: sql6 cursor union dropped
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |