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',...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: SQL | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 10596 | Hits: 795

Similar Posts

  • Ruminations on Multi-Tenant Data Architectures more
  • Script to Inventory Print Servers more
  • Running the Same Query Against Multiple Databases more
  • LINQ to SQL Dynamic Mapping more
  • Repairing SQL 2005 Business Intelligence Studio after uninstalling VS2005 more
  • SQL Server Compact Edition 3.5 more
  • Entity Framework vs. Linq to SQL more
  • A Library For Executing SQL Scripts With GO Separators and Template Parameters more
  • How to debug a stored procedure in your Sql Server 2005 more
  • LinqDataSource vs ObjectDataSource vs SqlDataSource more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD