Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAX TABLE IN A SELECT

Status
Not open for further replies.

desert88

Technical User
Apr 13, 2001
4
0
0
FR
i have a big sql query containting mor than 16 tables
when i execute this query, ihave this error message

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

how can i solve this problem.

 
Hiya,

There is nothing that you can do, 16 tables in the maximum that Sybase can handle in a single query.

Can you break the query down into several steps, maybe putting the information from several tables into one temporary table before processing the next stage?

More than 16 tables seems to be a very complex query...
 
Hello,
Actually there is no any rule about table limit in the query.You don't have to divide your query but you have to control your configuration parameters.
There is a parameter that called "Descriptor". It means how many objects can open at the same time.You can control how many descriptor you have for tables, views, indexes etc...

Command :
sp_configure
or
select * from sysconfigures (on master database)

Ersan Çam
 
ersancam,

i am actually facing the same query problem. I am joining more than 16 tables and searched the sybase website for this parameter called 'descriptor' and can't find it, and i also can't find it in sysconfigures and sp_configure. I can't break up the query because it is for a view. Sybase was pretty clear on their website that you can't join beyond 16 tables. Would it be possible if you can walk me through the steps you did to accomplish your recommendation aside from looking at sysconfigures and sp_configure.

thank you,
q.
 
Have you tried breaking some of the joins up into views that already reference a few of the tables. Then, you could join the views with the rest of the tables in the SELECT.

The only downside that I can think of is since views are only populated as needed, the resources required may be just as bad as an n-table join.

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top