Link Server


In SQL Server it is called a Linked Server whereas in Oracle it's DBLinks (Database Links).


It’s best in some ways when you are trying to run dynamic complex queries  across heterogeneous data source. There are many instances that OpenQuery/OpenRowSet and four-part qualifier calling might not work in the complex SQL design. The limitation of linked server will explode when are trying to manipulate data and write complex queries with heterogeneous data sources.

To execute a Stored Procedure:
The three methods to execute the SP on remote server are
  • Calling with four part naming convention
  • Using OpenQuery and OpenRowSet
  • Execute At LinkedServer

This four-part name should be in the form linked_server_name.catalog.schema.object_name. 

Pre-requisites

  • Make sure RPC and RPC Out parameters are set to TRUE
  • MSDTC is enabled to run distributed queries

Important tables
We can get Linked Server basic information by executing the following stored procedure created in the master database or default system. 
exec sp_linkedservers
Or 
sys.servers

Add a Linked Server
sp_addlinkedserver 

Drop a Linked Server
EXEC sp_dropserver 'LinkServerName' 

The use of Openquery, Openrowset and four part calling stored procedure might work in simple cases. When you are working with distributed queries with heterogeneous data source the use of EXECUTE … AT LinkedServer works best.


Reference:
https://www.mssqltips.com/sqlservertip/6083/understanding-sql-server-linked-servers/

Name

Azure Backup Database Clustering Crash Dumps DBCC Deadlock Link Server Log Shipping Maintenance Migration Mirroring Monitoring Performance Tuning Permissions Post Installations Prerequisites Replication Restore Database SQL Installations SQL on Linux SQL Uninstallations SSIS T-SQL Windows Server
false
ltr
item
hybriddba.blogspot.com: Link Server
Link Server
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQHqj1JchvtAxHjs-b9JdFCeP5axiBOQqrxm3tFbunLl5o6-VuZ6Nbud3FUwWO2CN07Du7mUAppFHltDILjAUly3fLZeexO1DSpbYGFKuv5BWAweqseS8IUgVR_TGGDveX9UiWJ90gjEGL/s1600/1579258402759997-0.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQHqj1JchvtAxHjs-b9JdFCeP5axiBOQqrxm3tFbunLl5o6-VuZ6Nbud3FUwWO2CN07Du7mUAppFHltDILjAUly3fLZeexO1DSpbYGFKuv5BWAweqseS8IUgVR_TGGDveX9UiWJ90gjEGL/s72-c/1579258402759997-0.png
hybriddba.blogspot.com
https://hybriddba.blogspot.com/2019/06/link-server.html
https://hybriddba.blogspot.com/
https://hybriddba.blogspot.com/
https://hybriddba.blogspot.com/2019/06/link-server.html
true
7679493960263860249
UTF-8
Not found any posts Not found any related posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Tag ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Contents See also related Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy