Error - Too many table names in the query.  The maximum allowable is 16.

Posted on 1999-07-08
Medium Priority
Last Modified: 2008-03-06
In one query maximum number of tables that we can use is 16.
Is there any server configuration parameter which sets this max. value or this is the limitation.
Question by:siddhartharathi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1096256
Unfortunatley this is a limitation on 6.5.
You can't even get round it using Views as the number of tables in the view are counted as well.
The only way to do it is to use a stored procedure and a temporary table and populate it with 2 or more SELECT statements
then do a select on the temporary table.
Not nice but that is SQL server 6.5

Accepted Solution

vandamme earned 20 total points
ID: 1096257
There is a fairly well-known undocumented trace flag that will increase the 6.5 table limit to 32 (by adding the 16 allowable worktables to the 16 allowable user tables).  I can't speak to whether Microsoft supports this trace flag.  It can be set by running the SQL Setup program:

Click through the next button until you encounter the "Set Server Options" radio button
Click on the "Set Server Options" radio button and click Next
Click on Parameters and enter "T105" (without quotes)
Click on ADD
Exit Setup program
Recycle the server  


Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question