Ghi
Quyền truy cập vào trang này yêu cầu sự cho phép. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Quyền truy cập vào trang này yêu cầu sự cho phép. Bạn có thể thử thay đổi thư mục.
Applies to:
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.
Transact-SQL syntax conventions
Syntax
sp_testlinkedserver [ @servername ] = servername
[ ; ]
Arguments
Important
Arguments for extended stored procedures must be entered in the specific order as described in the Syntax section. If the parameters are entered out of order, an error message occurs.
[ @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
EXECUTE sp_addlinkedserver 'SEATTLESales', N'SQL Server';
GO
EXECUTE sp_testlinkedserver SEATTLESales;
GO