Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have two SQL Server 2008 located in different cities.

I have physical access to one of them and I can exec SQL Server Management Studio there.

For second server I have following parameters:

  • remote domain name
  • remote port
  • login
  • password

With these parameters I can connect to second server with SQL Server Management Studio.

But now, I have to create cross server queries. It is possible? How? :)

Do I have to add Linked Server? How?

I see only this window, but where do I writer domain/port/login/password info?

enter image description here

share|improve this question

migrated from stackoverflow.com Jan 30 '12 at 14:46

This question came from our site for professional and enthusiast programmers.

3 Answers 3

Create a linked server is quite simple. Follow the below steps- Step 1 – Connect SQL server, using 'Database Engine' as server type along with proper Server name and authentication.

Step 2 – Into object explorer, navigate to linked server under 'Server Objects'.

Step 3 – Right click on 'Linked Servers' - select 'New Linked Server'. Fill all the required detail in respective dialog.

Step 4 – After filling the entire details click on Ok button, Linked server is configured and it should work. In case if it doesn't respond, once restart the SQL server.

For more detail click here

share|improve this answer

Instead of adding the linked server in the GUI (as alread described in SqlACID's answer), you can also add it by executing the system procedure sp_addlinkedserver instead.

To actually query tables from the linked server, your queries need to look like this:

SELECT * FROM Server.Database.Schema.Table
share|improve this answer

Change the server type to SQL server, put the servername,port number in the Linked Server name; on the Security section, change to "Be made using this security context" and enter the user name/password, assuming they are SQL Authentication credentials.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.