Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 querying on different database server

Author  Topic 

hybridGik
Starting Member

26 Posts

Posted - 2006-06-30 : 19:48:44
hi.

can we select records from a table on server "A" and then join it from a table residing on server "B"?

like:

select *
from [table from DBServer "A"]
inner join [table from DBServer "B"]
------------

what's the exact syntax.

Thanks.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-30 : 20:21:51
Yes. Using Linked Server.

First create a linked server at Server A link to B
Then you can reference table in ServerB using the the linked server nane

select *
from tableA -- in ServerA
inner join [ServerB].DB.dbo.tableB
inner join . . .




KH

Go to Top of Page

druer
Constraint Violating Yak Guru

314 Posts

Posted - 2006-07-03 : 15:12:04
Or check out OPENDATASOURCE in books online for how to pull data from any external source that you may not have linked.

Hope it helps,
Dalton

Blessings aren't so much a matter of "if they come" but "are you noticing them."
Go to Top of Page
   

- Advertisement -