Skip to content

Latest commit

 

History

History
64 lines (51 loc) · 1.92 KB

File metadata and controls

64 lines (51 loc) · 1.92 KB
description sp_testlinkedserver (Transact-SQL)
title sp_testlinkedserver (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology system-objects
ms.topic reference
f1_keywords
sp_testlinkedserver
sp_testlinkedserver_TSQL
dev_langs
TSQL
helpviewer_keywords
sp_testlinkedserver
ms.assetid e63ca7d4-47d6-455e-9aac-421f9683dadc
author markingmyname
ms.author maghan

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.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_testlinkedserver [ @servername ] = servername  

Arguments

[ @servername = ]servername Is the name of the linked server. servername is sysname, with no default value.

Result Sets

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  
sp_testlinkedserver SEATTLESales;  
GO  

See Also

sp_addlinkedserver (Transact-SQL)
sp_addlinkedsrvlogin (Transact-SQL)