Identify Which Connection Is Doing What in SQL Server


Through below script you are able to find out Which Connection Is Doing What in SQL Server at current point of time.

 


 

SELECT des.session_id,
 des.host_name,des.host_process_id,
 des.total_elapsed_time,
 (select text from sys.dm_exec_sql_text(r.sql_handle)) as command 
 FROM sys.dm_exec_sessions AS des left join sys.dm_exec_requests AS r 
 on r.session_id = des.session_id 
 where des.status ='running'order by command

you will get the output like below:-



 

Leave a Reply

Your email address will not be published. Required fields are marked *