Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/250467

From BetaArchive Wiki
Knowledge Base

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

Article ID: 250467

Article Last Modified on 10/3/2003


  • Microsoft SQL Server 6.5 Standard Edition

This article was previously published under Q250467

BUG #: 18244 (SQLBUG_65)


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.


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.


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

Keywords: kbbug kbpending KB250467