February 5, 2009 at 11:42 am
how to identify when a stored procedure is explicitly using
February 5, 2009 at 12:04 pm
I did not understand the question. Are you trying to track the execution of stored procedures?
.
February 5, 2009 at 12:08 pm
I want to know that which stored procedure is currently running in a database when it is being used by explicitly.
Thanks in advance for your quick responce.
February 5, 2009 at 12:13 pm
You can run the following query to see the queries/procedures currently being executed.
select object_name(objectid) as ObjectName,
SUBSTRING(st.text, (statement_start_offset/2)+1,
((CASE statement_end_offset
WHEN -1 THEN DATALENGTH(st.text)
ELSE statement_end_offset
END - statement_start_offset)/2) + 1) AS statement_text
, db_name(database_id) as dbname,blocking_session_id as BlockingWith, *
FROM
sys.dm_exec_requests r
CROSS APPLY
sys.dm_exec_sql_text(sql_handle) AS st
.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply