Using Linked Servers in SQL Server

When you work with software you have in mind that everything is interconnected, even more when you're talking about servers. And things could get really ugly if you need to make queries and see that a part of your information is located in another server.

Fortunately, Microsoft SQL Server helps us in this situation giving us a feature that allows us to reference a different server and use it to make queries against it.

So, let's open SQL Server Management Studio, get in to the server and go to "Linked Servers" folder located in "Server Objects".
 
Go to Linked Servers in SQL Server MS
 
Now, you have to create a new linked server by using the right-click button and the appropriate option.

Create a new linked server
 
In this ocasion, just type the linked server name on the textbox and select the type of this, keep in mind that you can connect to other sources different from SQL Server.

Complete the information of the linked server
 
After you do this, on the "Security" section you have to specify the mapping between users and for the rest of users you'll have to select the connection mode.

Configure the users for the linked server

Once you finish this, you will be able to query the data from your new linked server, this will appear under the "Linked Servers" folder. Since now you can build this kind of queries:

SELECT * FROM TEMP.CATALOGTEMP.DBO.TEMPTABLE

That's all.


Comments

Popular posts from this blog

I Need to Send an Automatic Email with Lotus Notes

Turn Horizontal Visio Swimlanes into Vertical Ones

Install TWRP Recovery in Xiaomi Redmi 6A