We are migrating SQL 2008 instances to SQL 2014. Looking for help regarding Linked Servers.
Is there a way to script out all linked servers along with passwords?
Appreciate if anyone can help.
Thank you.
Hi,
Basically looking for script which can script out all Linked Servers.
Thanks
Hi Samantha,
According to your description, you need to list all the linked servers on one server by using a script, right?
There are several methods for viewing the details of linked servers in SQL Server. One can use the SSMS UI to view properties or view facets, or one can even read through the scripted linked server. The easiest method to view the details for one or all linked servers is the query the SQL Server system tables. Here is the sample script for you reference.
SELECT * FROM sys.Servers a LEFT OUTER JOIN sys.linked_logins b ON b.server_id = a.server_id LEFT OUTER JOIN sys.server_principals c ON c.principal_id = b.local_principal_id
Reference
http://jwcooney.com/2011/10/26/sql-server-how-to-list-the-full-properties-of-all-linked-servers/