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)
 Selecting Data from 2 different Databses

Author  Topic 

beedeep
Starting Member

2 Posts

Posted - 2004-11-19 : 06:14:23
Hello All,

I need to select data from 2 different databases sitting on 2 different servers. and then update the other one depending on some criteria.

for eg. i need to do somethig like this.

SELECT A.*,B.* FROM Server1...Database1..[dbo].TB_Company A
INNER JOIN
Server2...Database2..[dbo].TB_Company.Account B
ON A.Account = B.Account

is this possible ??

i know it is possible if it is on the same server but not very sure if it is on another server.

any help will be very helpful

Many thanks

Deep

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-11-19 : 06:27:32
look up linked serverver in SQL help = Books OnLine = BOL
and also check 4 part naming: serverName.dbName.ownerName.tableName

Go with the flow & have fun! Else fight the flow
Go to Top of Page

beedeep
Starting Member

2 Posts

Posted - 2004-11-19 : 06:43:33
Many Thanks spirit1

Got my problem solved. but had to replicated that locally on my machine as i didn't have permission to excute the system procedure on our shared hosting.


Thanks

Deepesh
Go to Top of Page
   

- Advertisement -