SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 join tables on different servers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

eugz
Posting Yak Master

195 Posts

Posted - 09/27/2013 :  16:03:27  Show Profile  Reply with Quote
Hi All.

How to join tables on different servers if one server, for instance, SERVER2 required authentication?

Thanks.

James K
Flowing Fount of Yak Knowledge

3568 Posts

Posted - 09/27/2013 :  16:10:38  Show Profile  Reply with Quote
Set up a linked server connection to the remote server. See this page for how http://technet.microsoft.com/en-us/library/ff772782.aspx If you have never done it before, it might be easier to use the description under "Using SQL Server Management Studio".

When you set up the linked server, the dialogs have places where you can provide the details and authentication information for the remote server.

Once you have the linked server set up correctly, you would refer to the remote table using the four part naming convention - ServerName.DatabaseName.SchemaName.Tablename. See here for how that works: http://www.mssqltips.com/sqlservertip/1095/sql-server-four-part-naming/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 09/28/2013 :  03:15:32  Show Profile  Reply with Quote
see this which explains all steps in creating a linked server programatically

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=164892

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000