Thursday, August 1, 2019

SQL Server list connection details between dates

SELECT 
    c.session_id, c.net_transport, c.encrypt_option, 
    c.auth_scheme, s.host_name, s.program_name, 
    s.client_interface_name, s.login_name, s.nt_domain, 
    s.nt_user_name, s.original_login_name, c.connect_time, 
    s.login_time 
FROM sys.dm_exec_connections AS c 
JOIN sys.dm_exec_sessions AS s 
    ON c.session_id = s.session_id
where last_request_start_time
between  '2019-07-29' and '2019-08-01'

No comments:

Post a Comment