Sunday, February 12, 2012

are there any sql servers?

I have two servers, however sometimes connection break out. can i detect sql
server accessable on other server at anytime?Ping Server
CREATE TABLE #t_ip (ip varchar(255))
DECLARE @.PingSql varchar(1000)
SELECT @.PingSql = 'ping ' + '0.0.0.0'
INSERT INTO #t_ip EXEC master.dbo.xp_cmdshell @.PingSql
IF EXISTS (SELECT TOP 2 * FROM #t_ip WHERE IP = 'Request timed out' )
BEGIN
DROP TABLE #t_ip
RETURN
END
DROP TABLE #t_ip
"Sava Gltekin" <savas@.merkez.com.tr> wrote in message
news:OCmj26bvFHA.3764@.TK2MSFTNGP09.phx.gbl...
>I have two servers, however sometimes connection break out. can i detect
>sql server accessable on other server at anytime?
>

No comments:

Post a Comment