Search code examples
sqlsql-servertriggersclient

Detecting disconnection of the client in SQL Server


When a client connection with the SQL Server (from client side) is cut, how can I detecting this disconnection in SQL Server (2008 or 2012)?

Can I solve this problem with Server Triggers?


Solution

  • You can create an event notification for the Audit Logout event. The notification can launch an activated procedure. Consider though that event notifications are asynchronous.