how to identify when a stored procedure is explicitly using

  • how to identify when a stored procedure is explicitly using

  • I did not understand the question. Are you trying to track the execution of stored procedures?

    .

  • 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.

  • 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