TechNet
Export (0) Print
Expand All

sp_testlinkedserver (Transact-SQL)

 

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Tests the connection to a linked server. If the test is unsuccessful the procedure raises an exception with the reason of the failure.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions

  
sp_testlinkedserver [ @servername ] = servername  

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

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

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

Community Additions

ADD
Show:
© 2016 Microsoft