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
 SQL Server Development (2000)
 Selecting data from 2 different DBs on 2 different servers

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-14 : 07:19:00
Anil writes "Is it possible to select the data from 2 different databases on two different SQL servers?
thanks,
A"

JasonGoff
Posting Yak Master

158 Posts

Posted - 2004-06-14 : 07:42:40
Yes, look under Book Online regarding DTC (Distributed Transaction Coordinator) and RPC (Remote Procedure calls).
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-06-14 : 08:03:52
Just set up a linked server between the two SQL Servers. You can see how to do that in Books Online. If you need help, we'll walk you through the process.

You can the select like this:

SELECT t1.column1, t2.column2
FROM server1.database.dbo.table t1
INNER JOIN server2.database.dbo.table t2

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

srinivasanr
Starting Member

15 Posts

Posted - 2004-06-14 : 08:15:09
hi,
Use SP_ADDLINKEDSERVER to link the server and use four-part name like this..
[SERVERNAME].[DB Name].dbo.[TABLE NAME]

Note : To check whether the servers are linked use " SELECT * FROM SYSSERVERS "

Wallops!!
Go to Top of Page
   

- Advertisement -