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

ID: Q138263


The information in this article applies to:
  • Microsoft SQL Server version 6.0


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 : winnt:6.0
Platform : winnt
Issue type :


Last Reviewed: December 14, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.