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

Article translations Article translations
Article ID: 247056 - View products that this article applies to.
This article was previously published under Q247056
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 55934 (SQLBUG_70)
Expand all | Collapse all

On This Page


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 may occur if the following conditions are true:
  • The view was created using a UNION clause.

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


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.


Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
254561 INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.


Steps to Reproduce the Problem

The following script demonstrates the problem:
Create Table table1(a int, b int)
Create Table table2(c int, d int)

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

--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)


Article ID: 247056 - Last Review: October 22, 2013 - Revision: 2.1
  • Microsoft SQL Server 7.0 Standard Edition
kbnosurvey kbarchive kbbug kbfix KB247056

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from