General information
Title:
Quickly determine if SQL server is available
I need to find a way to "quickly" determine if a SQL Server is available. So far, everything I have tried takes several seconds to determine if a server is not available.
I tried SQLSetProp(0,'ConnectTimeOut',1). It seemed to have no effect on a server that was not present. According to some, they achieved a response time of 2-3 seconds. Didn't work for me and even if it did, this is pretty slow.
I tried SQL-DMO. loServer.LoginTimeOut seemed to have no effect on a server that was not present. Took it about 15 seconds to determine the server was not there regardless of my setting for the timeout.
I tried to look at the RegisteredServers collection of the ServerGroup object, but it contained servers that had long been gone.
I tried PingSQLServerVersion method of the SQLServer object. Errored after several seconds.
I understand WMI just wraps DMO. So I haven't gone there yet.
I could ping the server with TCP\IP, but that wouldn't really tell me if SQL is running.
Anybody know how I can get a fast determination? Thanks
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only