Microsoft KB Archive/158418

= BUG: SELECT on Cross-Database Views Causes Error 702 =

Article ID: 158418

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft SQL Server 6.0 Standard Edition
 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q158418



BUG #: 15312



SYMPTOMS
If you query on views created on tables present in another database, you may receive error message 702. The text of the error message is:

Memory request for bytes exceeds the size of single page of

bytes.



WORKAROUND
To work around this problem, either run the query on the base table itself, or wrap the query inside a stored procedure and then run the stored procedure.



STATUS
Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
This error may occur if the query is run from the database in which the views reside, and the query contains many joins, UNIONs, ANDs, and several subqueries.

For example, suppose you have created two databases, DB1 and DB2. The tables are present in DB1, and the views are created in DB2 from the tables in DB1. The query you are using is complex, as described above. To prevent this error message from occurring, you can do any of the following:


 * Wrap the query inside a stored procedure.
 * Insert UNION clause into a temporary table and then perform the UION on the temporary table.
 * Remove one of the subqueries.
 * Remove several of the AND conditions.

Additional query words: SQL60 SQL65 UNION

Keywords: kbbug kbnetwork KB158418

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.