title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sp_testlinkedserver (Transact-SQL) |
sp_testlinkedserver tests the connection to a linked server. |
markingmyname |
maghan |
randolphwest |
04/08/2024 |
sql |
system-objects |
reference |
|
|
|
[!INCLUDE 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.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_testlinkedserver [ @servername ] = servername
[ ; ]
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