SQL Server FAQ : How to join tables from different servers
Posted by: Mihir Solankis .NET Journal,
on 08 Dec 2005 |
View original | Bookmarked: 0 time(s)
To be able to join tables between two SQL Servers, first you have to link them. After the linked servers are setup, you just have to prefix your tables names with server name, database name, table owner name in your SELECT queries. The following example links SERVER_01 to SERVER_02. Execute the following commands in SERVER_02:
EXEC sp_addlinkedserver SERVER_01GO
/* The following command links 'sa' login on SERVER_02 with the 'sa' login of SERVER_01 */EXEC sp_addlinkedsrvlogin @rmtsrvname = 'SERVER_01',...