Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to test for network connection to linked server?

Status
Not open for further replies.

bcouse

Programmer
Jun 28, 2001
8
US
Hi All,

Does anyone know how to test to see if a linked server really exists? Not that the link exists, rather that the actual server can be reached over the network. For example, if I execute the following query:

select count(*) from server99.testdb.dbo.user_accounts

I am returned the following
Server: Msg 6, Level 16.... Specified SQL server not found

This occurs when the server happens to be down or the network connection has been disrupted. Does anyone know how a connection test can be performed in a stored proc?

Appreciate the assistance...
Brad
 
If your dba hasnt disable or you could use xp_cmdshell to see if you can ping the server

DECLARE @pingserver int
EXEC @pingserver = xp_cmdshell 'ping 192.168.x.x'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top