Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Querying over 2 servers
Message
From
29/01/1999 10:41:05
 
 
To
29/01/1999 05:21:30
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00181706
Message ID:
00181810
Views:
8
>I have two databases that reside on different servers. I need to run a query that takes information from both databases and produces a results set summarising the two.
>
>Is it possible to construct a query that spans two servers? I cannot find anything in Technet or on MS technical support.
>
>I know that I could replicate one database to the other server, but these are 3GB databases and I don't want to use up that much space for the sake of the occasional query.
>
>Any ideas...?

This is really easy with SQL Server 7.0. It added linked servers that support the kind of functionality that you're asking for.

For 6.5 you'll have to do some work. You can call a remote-stored procedure to query the data on one server and stuff it into a temporary table. Then join that table with the other "half" of the query. Lookup remote stored procedures and INSERT w/ EXECUTE in the BOL.
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform