sp_testlinkedserver (Transact-SQL)
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
[ @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
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho