• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

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

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.
1 Solution
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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now