Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.59 KB

sp-testlinkedserver-transact-sql.md

File metadata and controls

66 lines (47 loc) · 1.59 KB
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
sp_testlinkedserver
sp_testlinkedserver_TSQL
sp_testlinkedserver
TSQL

sp_testlinkedserver (Transact-SQL)

[!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

Syntax

sp_testlinkedserver [ @servername ] = servername
[ ; ]

Arguments

[ @servername = ] N'servername'

The name of the linked server. @servername is sysname, with no default.

Result set

None.

Permissions

No permissions are checked. However, the caller must have the appropriate login mapping.

Examples

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

Related content