Export (0) Print
Expand All

sp_testlinkedserver (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

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.

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;
EXEC sp_addlinkedserver 
    N'SQL Server';
sp_testlinkedserver SEATTLESales;
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft