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

Last reviewed: May 1, 1997
Article ID: Q138263

The information in this article applies to:
  • Microsoft SQL Server, version 6.0
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 : kbbug6.00 kbfix6.00.sp2 kbprg SSrvProg SSrvTran_SQL
Version : 6.0
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 1, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.