Hi Nirmal,
ur query is
1. Cross database
select a.col_name ,*
from pubs..anytable a join northwind..anytable1 b as "ur condition"
2. Cross server
select a.col_name
from server1.pubs..anytable a join server2.northwind..anytable1 b as "ur
condition"
for cross server queries u need to link bothe databases, u can do this
by starting enterprise manager
go to server name>security> linked servers
it'll guide u from there .
Gurus do correct me if i m wrong somewhere , as i m new to the DBA world.
Aman
-----Original Message-----
From: Nirmal C.Kumar [mailto:[Email Address Removed] Thursday, January 30, 2003 5:06 PM
To: LazyDBA.com Discussion
Subject: query between 2 servers/databse
List
Can you help me to figure out how to go in writing a query a select or a
insert combining 2 tables from more than 1 database .What's the syntax .
For example :
1. I need to write a select for a table joining a table from a pubs and
northwind .
2. How can I combine a single query from 2 database server .
Nirmal
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page