Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Tests the connection to a linked server. If the test is unsuccessful, the procedure raises an exception with the reason of the failure.
Transact-SQL syntax conventions
sp_testlinkedserver [ @servername ] = servername
[ ; ]
Important
Arguments for extended stored procedures must be entered in the specific order as described in the Syntax section. If the parameters are entered out of order, an error message occurs.
The name of the linked server. @servername is sysname, with no default.
None.
No permissions are checked. However, the caller must have the appropriate login mapping.
The following example creates a linked server named SEATTLESales
, and then tests the connection.
USE master;
GO
EXEC sp_addlinkedserver 'SEATTLESales', N'SQL Server';
GO
EXEC sp_testlinkedserver SEATTLESales;
GO
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today