BUG: Error 8630 When Querying A View Created with a UNION Clause

ID: Q247056


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

BUG #: 55934 (SQLBUG_70)

SYMPTOMS

When you run a SELECT statement to retrieve data from a view, the following error message may appear:

Server: Msg 8630, Level 17, State 38, Line 1
Internal Query Processor Error: The query processor encountered an unexpected error during execution.
This error can occur if the following conditions are true:
  • The view was created using a UNION clause.

    -and-


  • The SELECT statement used to retrieve data from the view has a subquery in its WHERE clause.



WORKAROUND

To work around this problem, try one of the following:

  • Query the table rather than the view.


  • Avoid creating the view with the UNION clause.


  • Avoid using a subquery in the WHERE clause.



STATUS

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


MORE INFORMATION

Steps to Reproduce the Problem

The following script demonstrates the problem:

Create Table table1(a int, b int)
go
Create Table table2(c int, d int)
go

Create View view1 as 
Select a, b From table1
Union
Select a, b From table1
go

--The following query reproduces the error

Select a From view1 where
a <> (select c from table2 where d = b) and
a <> (select c from table2 where d = b)
go 

Additional query words: Error 8630;

Keywords : SSrvTran_SQL kbbug7.00
Version : winnt:7.0
Platform : winnt
Issue type : kbbug


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