BUG: Opening Cursor When Using ISNULL() Function May Cause An Access Violation (250467)



The information in this article applies to:

  • Microsoft SQL Server 6.5

This article was previously published under Q250467
BUG #: 18244 (SQLBUG_65)

SYMPTOMS

An access violation (AV) is possible when a cursor opened on a SELECT statement satisfies the following conditions:
  • Contains the ISNULL() function.
  • Joins at least two tables.
  • The cursor is not declared as keyset or insensitive.
  • The tables do not have unique indexes.

WORKAROUND

To work around this use these steps:
  1. Switch the tables in the FROM clause, such that the first table is the one being referenced by ISNULL(). If there are more than two tables where the ISNULL() function is used, then this option may not work.
  2. Create a unique clustered index on the table(s) referenced by ISNULL().
  3. Change the cursor to keyset or insensitive.
  4. Avoid the use of the ISNULL() function.
  5. Create unique indexes on the tables involved.

STATUS

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

Modification Type:MajorLast Reviewed:10/3/2003
Keywords:kbBug kbpending KB250467