Query - Running Sessions in SQL Server

Below
query give us list of Running Sessions in Database.

select
r.session_id,
s.login_name,
st.text,
s.status,
blocking_session_id,
start_time,
last_read,
command
from sys.dm_exec_requests r
inner join sys.dm_exec_sessions s
on r.session_id = s.session_id
left join sys.dm_exec_connections c
on r.session_id = c.session_id
outer apply sys.dm_exec_sql_text(r.sql_handle) st
where client_net_address is not null and text is not null and s.status = 'running'
order by 3

Running Sessions



Comments