Friday, April 29, 2011

Get list of all currently running procedure in SQL Server

Sometimes it is a need to find out which stored procedure are running on the SQL Server.Below SQL query will provide the list of stored procedure which are currently running on the server.
SELECT OBJECT_NAME(ObjectID) as ObjectName,
  st.Text, 
  DB_NAME(database_ID) as dbname,
  Blocking_session_ID as BlockingSessionID,  
  *
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS st
back to top