Is it possible to check if a SPROC is running?

  • Hello,

    I am working with an application developer and we have an application that calls a Store Procedure. Is there a way to query the database to determine if a specific Stored Procedure is running? If yes, can someone provide the tables I would need to reference?

    The goal is we would have the application use this query to check/poll if the PROC is done before moving to the next step.

  • rjjh78 - Thursday, August 3, 2017 3:12 PM

    Hello,

    I am working with an application developer and we have an application that calls a Store Procedure. Is there a way to query the database to determine if a specific Stored Procedure is running? If yes, can someone provide the tables I would need to reference?

    The goal is we would have the application use this query to check/poll if the PROC is done before moving to the next step.

    Try something like:
    SELECT t.text,
    r.session_id,
    r.status,
    r.command
    FROM sys.dm_exec_requests r
    CROSS APPLY sys.dm_exec_sql_text(sql_handle) t
    WHERE text like '%YourStoredProcedure%'

    Sue

  • sys.dm_exec_procedure_stats
    does that.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply