Client disconnect detection in SQL Server

When the client connection to SQL Server (on the client side ) is reduced, how can I detect this disconnect in SQL Server (2008 or 2012)?

Can I solve this problem with server triggers ?

+5
source share
2 answers

You can create event notification for Audit Logout event. A notification may trigger an activated procedure. Note that event notifications are asynchronous.

+3
source

You can query one of the tables sys( sysprocesses)

SELECT 
   DB_NAME(dbid) AS Database, 
   loginame AS LoginName
FROM  sys.sysprocesses

, , :

 sp_who2 

SQL , , .

+2

All Articles