Solved

SQL Server Distributed Query  - what is the limit to how many different db's can be accessed in one query.

Posted on 2004-03-23
3
244 Views
Last Modified: 2007-12-19
Using a distributed, also called heterogeneous query with SQL Server 2000, what is the maximum number of different databases that can be referenced in a single query?     SQL Server 2000 supports  2^16-1 - 32767 databases in a named instance.    Again, the question is,  in a distributed query, such as :

SELECT s1.income, s2.contractlength  from  server1.database.owner.table s1, server2.database32.owner.table s2

how many different db's can be referenced in one query, is it indeed up to 32767 ? Or, can you cross query across 5 instances, including 150,000 references to db+table in the query.

Granted, 150,000 databases may seem absurd, however, I am wondering what the maxium is, whether it is 16 different databases, or even 32,767.

Tim Miltz

0
Comment
Question by:tfmiltz
3 Comments
 
LVL 13

Accepted Solution

by:
danblake earned 250 total points
ID: 10666269
It all becomes a lot lower:
Tables per SELECT statement 256...

So you can only reference a maximum of 256 different objects in a single query. (from linked servers/views/tables)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now