This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 469518 (SQL Server 8.0)
This bug occurs in Microsoft SQL Server 2000 build 613. If you have installed a fix after you installed SQL Server 2000 Service Pack 2 (SP2), you may see this bug.
For additional information about how to determine your version of SQL Server 2000, click the following article number to view the article in the Microsoft Knowledge Base:
321185 HOW TO: Identify your SQL Server service pack version and edition
When you run a Transact-SQL statement that references many views, the Transact-SQL statement may not be successful. You may receive the following error message:
Server: Msg 4414, Level 16, State 1, Line 1 Could not allocate ancillary table for view or function resolution. The maximum number of tables in a query (256) was exceeded."
A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.
If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.
Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.
The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.
A SELECT Transact-SQL statement can reference a maximum of 256 tables. This limit includes the table and the views that are referenced in the statement. The limit also includes the tables and the views that are referenced by a view that is included in the query. Therefore, if a table or a view is referenced more than one time in the query, each reference to the table or the view (or the tables and views that are referenced in the view) counts against this limit. For more information, see the "Maximum Capacity Specifications" topic in SQL Server Books Online.
After you apply this hotfix, the query can reference a maximum of 260 tables and views. Therefore, you may still receive the error message that is mentioned in the "Symptoms" section of this article. If you still receive the error message, you may have to break up the query so that a lower number of tables or views is referenced in the query. You can change the view definition in the query to a lower number of tables that are referenced in the view.
For a SQL Server 2000 Service Pack 3 version of this fix, see the following article in the Microsoft Knowledge Base:
828269 FIX: A Transact-SQL query that uses views may fail unexpectedly in SQL Server 2000 SP3