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)
 How to write a query that joins multiple tables fr

Author  Topic 

pras2007
Posting Yak Master

216 Posts

Posted - 2008-06-25 : 16:57:24
Hello All,

Does anyone know how to join multiple tables from multiple servers? The sample code is below. Please advice.

Sample code:

INSERT INTO Results_Table
SELECT
1stServer.Column,
2ndServer.Column
FROM Test_table

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-25 : 17:05:55
You'll need to use a linked server and then use the four-part naming convention for the remote object:
LinkedServerName.DatabaseName.ObjectOwner.ObjectName

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -