I have one question simple.

I have a service which checks a database for new entries and scan at 30 secs intervals. If I reboot the SQL Server, this service crashes, even if I have error handling.

My question is, is there a way to detect when the connection is OPENED that the server is not accessible and make it wait? I tought this was the connection timeout thing, but it doesn't seem it works when the connection is already established.

Thank you!