FIX: SELECT w/ IN Clause Causes AV w/ Subquery SELECT NULL

ID: Q138263

The information in this article applies to: BUG#: 11525 (6.00)

SYMPTOMS

A simple SELECT statement with an IN clause and a subquery of the form SELECT NULL may cause a handled access violation in SQL Server version 6.0. The problem also occurs with a NOT IN clause instead of an IN clause in the query. However, if the subquery returns null results, the access violation does not occur.

WORKAROUND

If the subquery is replaced with the NULL keyword, the access violation does not occur.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.0. This problem was corrected in Service Pack 2 for SQL Server version 6.0. For more information, contact your primary support provider.

MORE INFORMATION

The following query will cause an access violation on SQL Server 6.0:

   use master
   go
   sp_dboption pubs,'select',true
   go
   use pubs
   go
   checkpoint
   go
   select au_lname,au_fname
   from authors
   where 100  in (select null)
   go

Additional query words: sql6 null in nt windows
Keywords          : kbprg SSrvProg SSrvTran_SQL kbbug6.00 kbfix6.00.sp2 
Version           : 6.0
Platform          : WINDOWS

Last Reviewed: May 2, 1997