Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Querying over 2 servers
Message
De
29/01/1999 10:41:05
 
 
À
29/01/1999 05:21:30
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00181706
Message ID:
00181810
Vues:
9
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform