Answer the question
In order to leave comments, you need to log in
How to get the date of the user's last connection to a SQL Server 2016 database?
Actually, the essence of the question is in the title.
There is a clue - user sessions are written in the sys.dm_exec_sessions table, but for some reason not all of them.
SELECT login_name, max(last_successful_logon) as last_logged_in
FROM sys.dm_exec_sessions
GROUP BY login_name
CREATE USER test1 FOR LOGIN test1 WITH DEFAULT_SCHEMA = 'test1'
Answer the question
In order to leave comments, you need to log in
Answer .
Especially:
If the common criteria compliance enabled server configuration option is enabled, logon statistics are displayed in the following columns:
last_successful_logon
last_unsuccessful_logon
unsuccessful_logons
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question