| title | sp_linkedservers (Transact-SQL) | ||
|---|---|---|---|
| description | sp_linkedservers returns the list of linked servers defined in the local server. | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | system-objects | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!INCLUDE SQL Server]
Returns the list of linked servers defined in the local server.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_linkedservers
[ ; ]
None.
0 (success) or a nonzero number (failure).
| Column name | Data type | Description |
|---|---|---|
SRV_NAME |
sysname | Name of the linked server. |
SRV_PROVIDERNAME |
nvarchar(128) | Friendly name of the OLE DB provider managing access to the specified linked server. |
SRV_PRODUCT |
nvarchar(128) | Product name of the linked server. |
SRV_DATASOURCE |
nvarchar(4000) | OLE DB data source property corresponding to the specified linked server. |
SRV_PROVIDERSTRING |
nvarchar(4000) | OLE DB provider string property corresponding to the linked server. |
SRV_LOCATION |
nvarchar(4000) | OLE DB location property corresponding to the specified linked server. |
SRV_CAT |
sysname | OLE DB catalog property corresponding to the specified linked server. |
Requires SELECT permission on the schema.
- sp_catalogs (Transact-SQL)
- sp_column_privileges (Transact-SQL)
- sp_columns_ex (Transact-SQL)
- sp_foreignkeys (Transact-SQL)
- sp_indexes (Transact-SQL)
- sp_primarykeys (Transact-SQL)
- sp_table_privileges (Transact-SQL)
- sp_tables_ex (Transact-SQL)
- System stored procedures (Transact-SQL)
- Distributed Queries stored procedures (Transact-SQL)