BUG: Distinct Subquery in Stored Proc Causes Access Violation

Last reviewed: April 30, 1997
Article ID: Q121236

The information in this article applies to:

  - Microsoft SQL Server, version 4.21 for Alpha
BUG# NT: 911 (4.21 - NTAlpha)

SYMPTOMS

On Microsoft SQL Server for Windows NT on DEC Alpha, a stored procedure may cause an access violation that terminates the client process if it selects based on IN or NOT IN criteria from a subquery returning a DISTINCT result column and with SQL Server's memory setting set to approximately 5120 pages or higher.

NOTE: This behavior does not occur in Microsoft SQL Server for Windows NT on Intel or Microsoft SQL Server for Windows NT on MIPS.

WORKAROUND

Run the SELECT outside of a stored procedure, or change the subquery to the following:

   SELECT pub_id FROM publishers GROUP BY pub_id

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 4.21 for Windows NT on DEC Alpha. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The follow query duplicates this problem when SQL Server's memory is more than 5120 pages:

   USE pubs
   GO
   CREATE PROCEDURE test AS
   SELECT * FROM publishers WHERE pub_id NOT IN (SELECT DISTINCT pub_id
   FROM publishers)
   RETURN
   GO
   EXEC test


Additional query words:
Keywords : kbbug4.21 kbprg SSrvRISC SSrvStProc SSrvWinNT
Version : 4.21
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: April 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.