FIX: QUERY Statement Causes 512 Error When You Access a View

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

Symptoms

A QUERY statement may cause a 512 error:
Subquery returned more than 1 value. This is not permitted...
under the following conditions:
  • It queries a view.
  • The view unions a table with itself.
  • The table contains more than one row with a null value in the same column.

Status

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.

More information

The query that follows returns the 512 error:
SELECT * FROM testview WHERE (1 = (SELECT (1)))
				
When used with this table/view definition:
create table testtable (col1 integer, col2 integer)
insert into testtable values (1,null)
insert into testtable values (2,null)
go

create view testview as
select col1 from testtable
union 
select col1 from testtable
go
				

Properties

Article ID: 254806 - Last Review: November 2, 2013 - Revision: 3.0
Applies to
  • Microsoft SQL Server 7.0 Standard Edition
Keywords: 
kbnosurvey kbarchive kbbug kbfix KB254806

Contact us for more help

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