BUG: DECLARE Dynamic Cursor with ORDER BY Causes Access Violation (239810)
The information in this article applies to:
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.
Modification Type: | Major | Last Reviewed: | 10/3/2003 |
---|
Keywords: | kbBug kbpending KB239810 |
---|
|