running stored procedures

  • How can I know if a certain stored procedure is being running at present time?

  • armando.horcajo (7/1/2008)


    How can I know if a certain stored procedure is being running at present time?

    You can run SQL profiler for detailed report or run sp_who2 or dbcc inputbuffer(spid) for each spid> 50 that are active.

    SQL DBA.

  • or use this:

    select st.text, * from master..sysprocesses

    cross apply sys.dm_exec_sql_text(sql_handle) st

    OR select st.text,ec.* from sys.dm_exec_connections ec

    cross apply sys.dm_exec_sql_text(most_recent_sql_handle) st

  • Dear SanjayAttray:

    Thank you for your answer.

    I am not a very experimented user !!!!!

    How can I identify the SPID of my Stored procedure?

  • Dear Mani:

    Thank you for your answer.

    I am not a very experimented user !!!

    Both scripts you wrote do not run correctly. I get an error message related to the word "apply". Perhaps I am using an older SQL version (7.0) ?

  • SQL 7.. then you need to go with Sanjays Answers...

    Also include sysprocesses.

Viewing 6 posts - 1 through 5 (of 5 total)

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