Thursday, July 14, 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.

1
2
3
4
5
6
7
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

No comments:

Post a Comment