Microsoft KB Archive/249628

= BUG: Dynamic Cursor Inside a Stored Procedure Using ISNULL or Date Function May Cause AV =

Article ID: 249628

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q249628



BUG #: 17695 (SQLBUG_65)



SYMPTOMS
If a dynamic SELECT cursor is created using the ISNULL function or a date function, it results in an access violation (AV) when executed. For the access violation to occur, the following conditions must be met:  Cursor must be used inside a stored procedure. A Clustered index must exist on the field that is involved with the function.  The returned column is used in an ORDER BY clause. For example: declare c1 cursor for select Field1, ISNULL(Field2, 123456) As FieldX from tblTest order by FieldX 

The problem occurs on all builds of SQL Server 6.5, from release to Service Pack 5a. It does not occur in SQL Server 7.0.



WORKAROUND
Declaring the cursor as INSENSITIVE prevents the access violation from occurring.



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

Keywords: kbbug kbpending KB249628

-

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

© Microsoft Corporation. All rights reserved.