Skip to content

Instantly share code, notes, and snippets.

@patrickserrano
Created April 6, 2020 17:57
Show Gist options
  • Save patrickserrano/ac829805c5a41e84fdd9b003ca2e1a10 to your computer and use it in GitHub Desktop.
Save patrickserrano/ac829805c5a41e84fdd9b003ca2e1a10 to your computer and use it in GitHub Desktop.
DB Troubleshooting
-- See connections with status
select
c.session_id,
c.net_transport,
c.encrypt_option,
s.status,
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
order by c.connect_time asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment