How It Works: SQL Server LOGIN_STATS (sys.dm_exec_sessions)

Moved from:


To track the login statistical information, enable the sp_configure value ‘common criteria compliance enabled‘ setting and restart SQL Server.


The sys.dm_exec_sessions DMV is one way to query the statistical login information.


The rows shown in this example belong to the sa user on my system. The values are different because the values are obtained when the specific session was created (at login time for the individual session.)

For example:

Session 57 logged in at 15:49:54.383 and the previous, sa, successful login took place at 15:49:54.360 Where-as Session 67 logged in at 15:51:02.410 and the