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)
 Query analyzer and 2 database code help

Author  Topic 

shade73
Starting Member

4 Posts

Posted - 2005-11-10 : 21:31:18
How do you run a query off 2 different servers using code in sql query analyzer. Now I don't want to join tables & such.. I'm just trying to run one query on one server, and below it run another query on another server... in the same window

[999.999.999.99]SELECT * FROM blah
[255.255.255.25]SELECT * FROM blah_server_2

is there anyway to do this?? Sorry I'm only a beginner at SQL.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-11 : 00:10:48
You can add other Server as Linked Server

sp_addLinkedServer 'OtherServer'

Then run this

Select columns from OtherServer.DBName.dbo.tableName

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

shade73
Starting Member

4 Posts

Posted - 2005-11-14 : 10:58:44
Thanks, that's exactly what i needed!
Go to Top of Page
   

- Advertisement -