Microsoft KB Archive/239810

= BUG: DECLARE Dynamic Cursor with ORDER BY Causes Access Violation =

Article ID: 239810

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q239810



BUG #: 18041 (SQLBUG_65)



SYMPTOMS
A DECLARE cursor operation on a SELECT statement that uses an ORDER BY clause, causes an access violation (AV). This only occurs when the cursor type is dynamic (default type in SQL Server 6.5) and the ORDER BY clause references columns in a different order than specified in the SELECT clause. This is a thread-level, handled exception that only affects the current process.



WORKAROUND
This problem can be avoided if a different type of cursor is used. You can change the DECLARE statement to specify a SCROLL or INSENSITIVE cursor type.

Alternately, you can change the SELECT clause to match the order of the columns specified in the ORDER BY clause. The AV does not occur if the ORDER BY clause matches the column order in the SELECT list.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.5.

Additional query words: av abend spid die error dbprocess does not exist

Keywords: kbbug kbpending KB239810

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.