Complete a Server Assessment – Linked Servers

Below you will find the code to get information about the linked servers.  Simply select the text and copy to the Clipboard.

SELECT
a.name
, a.product
, a.data_source
, a.modify_date
, b.remote_name
, b.uses_self_credential
, c.name AS ‘PrincipalName’
, c.default_database_name
FROM master.sys.servers a
LEFT OUTER JOIN master.sys.linked_logins b
ON b.server_id = a.server_id
LEFT OUTER JOIN master.sys.server_principals c
ON c.principal_id = b.local_principal_id

This code was written using the Microsoft SQL Server documentation.  If you find that this code was copied from else where, please let me know so I can give proper credit.