?
Solved

Error : "Too many tables names"

Posted on 2001-08-23
10
Medium Priority
?
648 Views
Last Modified: 2007-11-27
Hi all,
 Here is my problem : we use Business Objects with data on SQL Server 6.5

Sometimes,users need to ask server to perform "big" queries with something like 18 tables names. In such case here is the error message they get :

[Microsoft][ODBC SQL Server Driver][SQL Server]Too many table names in the query.  The maximum allowable is 16. 106

My DBA is away for few days, so does anyboy here knows how to increase this limitation of 16 table names ?

regards.

Note : points will be upgraded up to 200 pts for full working answer in less than 1 hour. :-)

Mike
0
Comment
Question by:gklux
[X]
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
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 1

Expert Comment

by:kdg2000
ID: 6417423
Try to divide the large search into 2 nested searches.
If it is realized in the stored procedure, it Try to divide into 2 nested procedures.
0
 

Author Comment

by:gklux
ID: 6417553
kdq2000 :
 First of all, thank for interesting in my question.
I cannot accept your answer, because what I need is to know how can I upgrade the limitation. If I do what you say, it means that each time a user make a big query, I will have to do this specially for his report. It's not the goal.

Sorry

Mike

0
 
LVL 18

Expert Comment

by:nigelrivett
ID: 6417659
Afraid there is no way.
You would normally just change the SP to use an intermediate temp table but if you give the client app control of the database structure then I don't think there is a lot you can do.
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 3

Expert Comment

by:peteyhiggins
ID: 6417723
It's not about control of the database structure.  SQL Server is set up to be able to allocate only so much memory for database queries.  Having too many tables in the queries pushes this past the allowable limit, which could easily crash the entire program, so checks were put in to forbid this from happening.  It's not about having a longer wait, it's about the the db not crashing.  There is no way around this, especially in the older languages like 6.5, which didn't allow for a whole lot of user control.

If you don't want to break up the query into separate parts, the only way to do what you want is to use views.  If you know that the query will only target certain fields in the tables, create some views that each hold five or six of those fields.  Then run your database query against those views rather than against the base tables.  That might free up enough memory to let it work.
0
 
LVL 1

Expert Comment

by:kdg2000
ID: 6420761
If it would be possible to look at query, it is possible precisely to define(determine) paths of an output(exit) from the usual situation.
0
 

Author Comment

by:gklux
ID: 6430913
Hi all,
  I've found this in the Help file while looking ont he select statement syntax:

SELECT [ALL | DISTINCT] select_list
[INTO [new_table_name]
[FROM table_name [, table_name2 [?, table_name16]]
[WHERE clause]
[GROUP BY clause]
[HAVING clause]
[ORDER BY clause]
[COMPUTE clause]
[FOR BROWSE]]

It seems that this is a syntax restriction. does anybody knows if this restriction exists in SQL Server 7 ? And what about SQL server 2000 ?

Mike
0
 
LVL 18

Expert Comment

by:nigelrivett
ID: 6431207
v7 can have 256 tables.
0
 

Author Comment

by:gklux
ID: 6441133
nigelrivett : are you sure of this ?


Ekim
0
 
LVL 18

Accepted Solution

by:
nigelrivett earned 400 total points
ID: 6441308
yes
this works for @i = 255 - fails for @i = 256 with

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

set nocount on
declare @cmd varchar(8000)
select @cmd = 'select 1 from sysobjects'
declare @i int
select @i = 255
while @i > 0
begin
   select @cmd = @cmd + ',sysobjects s' + convert(varchar(10),@i)
   select @i = @i - 1
end
select @cmd = @cmd + ' where 1 = 0'
exec (@cmd)
0
 

Author Comment

by:gklux
ID: 6443739
thanks.

Ekim
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

771 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