Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Msg 106 - Too many table names error

Author  Topic 

Genesis
Starting Member

6 Posts

Posted - 2008-03-25 : 11:50:16
Hey guys,

I apologize if this question has been posted before. I've been getting the following error

"Too many table names in query. The maximum allowable is 256."

I currently have 9 tables joined together, and slightly confused on what this error message is referring to. Is it referencing the total number of table names WITHIN all 9 tables? If so, is there a way to increase the capacity? Thank you for all your help!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-25 : 11:52:19
Post the query.
Table names are not only physical table names, but also derived tables etc.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-03-25 : 11:59:25
.. and tables in views and views in views, etc...

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-03-25 : 11:59:27
You can't increase the capacity. It is a sql server limitation. As with all server limitations if you have reached the limit you are doing something wrong.

I'm going to guess some of these 9 tables are actually views. And I'm also going to guess that your queries contain lots column values that are the result of subqueries.

each reference to a table, either by way of a view, derived table, or subquery counts as a "table name" in a query. Even self joins, each instance is a new table.

Post your query as well as any referenced view definitions if you want some help.

Be One with the Optimizer
TG
Go to Top of Page

Genesis
Starting Member

6 Posts

Posted - 2008-03-25 : 12:11:26
Thanks for the help guys! Once you guys clarified that this error what all this error encompass, I have an idea on whats wrong.

TG you are right on the money... "I'm going to guess some of these 9 tables are actually views. And I'm also going to guess that your queries contain lots column values that are the result of subqueries." - TG

I'm currently modifying someone else's code that left the company, and wow, this query is not pretty. (lots of mouse-wheel action lol) Thanks for the help again guys!
Go to Top of Page
   

- Advertisement -