Solved

I want to join 2 tables from 2 different servers

Posted on 2007-04-03
3
228 Views
Last Modified: 2010-07-27
I want to join 2 tables from 2 different servers.  I envisioned something like:

SELECT *
FROM Server1.Datebase.table t1 LEFT JOIN Server2.Database.table t2 ON t1.Index = t2.Index

Can this be done in t-sql?
0
Comment
Question by:jamesrbarnes
3 Comments
 
LVL 21

Assisted Solution

by:Kevin3NF
Kevin3NF earned 100 total points
ID: 18843923
You need to set up the "other" server as a linked server.  Check out sp_addlinkedserver in Books Online, or look in the GUI for the version you are using...which is what...2000 or 2005?
0
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 300 total points
ID: 18844013
yes linked server
and 4 part naming

Servername.Datebasename.ownername.tablevieworfunctionName
0
 
LVL 2

Assisted Solution

by:poogy21
poogy21 earned 100 total points
ID: 18849202
yes. setup a "linked server" and you could do exactly that.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question