Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
FIX: A Transact-SQL query that uses views may fail unexpectedly in SQL Server 2000 SP2
Article ID: 818406 - View products that this article applies to.
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:
(http://support.microsoft.com/kb/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:
http://support.microsoft.com/contactus/?ws=supportNote 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.
Date Time Version Size File name -------------------------------------------------------------------- 24-Jan-2003 06:23 2000.80.732.0 29,244 Dbmslpcn.dll 17-Jan-2003 13:53 786,432 Distmdl.ldf 17-Jan-2003 13:53 2,359,296 Distmdl.mdf 11-Dec-2002 05:20 180 Drop_repl_hotfix.sql 02-Jul-2002 03:05 2000.80.650.0 107,088 Impprov.dll 17-Jan-2003 08:03 774,409 Instdist.sql 11-Dec-2002 05:20 1,402 Inst_repl_hotfix.sql 20-Aug-2002 03:54 2000.80.679.0 111,172 Logread.exe 15-Dec-2002 10:51 2000.80.717.0 90,692 Msgprox.dll 05-Mar-2003 05:47 2000.80.736.0 62,024 Odsole70.dll 02-Jan-2002 13:29 18,185 Qfe356326.sql 20-Aug-2002 04:17 2000.80.679.0 135,748 Qrdrsvc.exe 26-Aug-2002 10:19 2000.80.679.0 406,088 Rdistcom.dll 03-Oct-2001 13:06 437,302 Replcom.sql 20-Aug-2002 04:03 2000.80.679.0 152,136 Replmerg.exe 25-Nov-2002 09:13 1,004,990 Replmerg.sql 15-Dec-2002 10:51 2000.80.717.0 221,768 Replprov.dll 15-Dec-2002 10:51 2000.80.717.0 303,688 Replrec.dll 22-Jan-2003 06:57 1,002,101 Replsys.sql 03-Oct-2001 13:06 881,228 Repltran.sql 26-Aug-2002 10:19 2000.80.679.0 283,208 Rinitcom.dll 16-Sep-2002 10:01 390,045 Securityhotfix.sql 26-Aug-2002 10:19 2000.80.679.0 28,672 Sqlagent.dll 26-Aug-2002 06:09 2000.80.679.0 311,872 Sqlagent.exe 28-Aug-2002 04:02 2000.80.679.0 49,152 Sqlagent.rll 26-Aug-2002 10:19 2000.80.679.0 53,824 Sqlcmdss.dll 28-Aug-2002 04:10 2000.80.679.0 12,288 Sqlcmdss.rll 14-Jan-2003 09:09 2000.80.725.0 172,600 Sqlmap70.dll 02-May-2003 06:14 2000.80.743.0 7,483,473 Sqlservr.exe 01-Nov-2002 06:26 2000.80.698.0 45,644 Sqlvdi.dll 24-Jan-2003 06:23 2000.80.732.0 29,244 Ssmslpcn.dll 24-Jan-2003 06:23 2000.80.732.0 82,492 Ssnetlib.dll 02-Jan-2003 07:42 2000.80.722.0 25,148 Ssnmpn70.dll 02-May-2003 06:14 2000.80.743.0 49,228 Ums.dll 06-Apr-2002 13:38 2000.80.606.0 70,208 Xplog70.dll 06-Apr-2002 13:38 2000.80.606.0 53,828 Xpqueue.dll 06-Apr-2002 13:38 2000.80.606.0 156,228 Xprepl.dll 11-Jul-2002 12:30 2000.80.658.0 279,104 Xpstar.dll 16-Sep-2002 10:42 2000.80.686.0 98,872 Xpweb70.dll
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:
(http://support.microsoft.com/kb/828269/ )FIX: A Transact-SQL query that uses views may fail unexpectedly in SQL Server 2000 SP3