Once my app starts I will try to connect and I get err if connection is not established, which is great.
I keep persistent connection in my Node.js app and I struggle how to handle when connection is terminated later, when sql server is restarted or something. I get errors from
asked 07 Nov '14, 05:17
Unlike ADO.NET, there are no properties associated with the connection (i.e., there is no conn.State to test).
In this case, a liveness test can be implemented by executing a "SELECT 1" which will always succeed if a connection is present and fail when it isn't. But then you didn't want to use exec.
answered 10 Nov '14, 14:22