Tests the connection to a data source. If the test is unsuccessful the procedure raises an exception with the reason of the failure.
[ @servername = ] servername
Is the name of the connection. servername is sysname, with no default value.
The following example creates a connection named “myConnection”, tests the connection, and then drops it.
exec sp_addlinkedserver 'myConnection', 'MySql';
exec sp_testlinkedserver 'myConnection';
exec sp_dropserver 'myConnection';
Msg 40000, Level 16, State 0, Line 0
Unable to connect to any of the specified MySQL hosts.