Click to See Complete Forum and Search --> : Querying Across 2 Servers


Surrendermonkey
March 27th, 2001, 04:47 AM
Probably very simple, but I can't find the solution on my own...:-)
I wish to run a simple join select query on two tables in SQL Server 6.5. The problem lies in that the tables in question are identically named and located on different databases on different servers.
I have tried qualifying the table names with servername.databasename.owner.table, but receive the "maximum prefixes is two" error. Fair enough.
My intention is to have the Server names and database names passed to vb on the command line (The tables' name does not change), so I cannot perform any design-time tricks like linking the tables into access.
How can I implement this?
Thanks people,

surrendermonkey.

Colon-Hyphen-Close-Bracket

Clearcode
March 27th, 2001, 05:05 AM
AFAIK, You cannot query across servers at all.

You can query across databases though.

How about copying the table from the one server to the tempdb database on the other server and then comparing them?

Not efficient for big tables, I'm afraid.

HTH,
Duncan

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

Surrendermonkey
March 27th, 2001, 05:11 AM
Oh.
Fair enough.
I suppose I'll just open two connections and force it. It's only three or four thousand records.
cheers anyway,

surrendermonkey.

Colon-Hyphen-Close-Bracket