July 1, 2008 at 11:52 am
How can I know if a certain stored procedure is being running at present time?
July 1, 2008 at 12:11 pm
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.
July 1, 2008 at 2:16 pm
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
Maninder
www.dbanation.com
July 2, 2008 at 2:18 pm
Dear SanjayAttray:
Thank you for your answer.
I am not a very experimented user !!!!!
How can I identify the SPID of my Stored procedure?
July 2, 2008 at 2:23 pm
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) ?
July 2, 2008 at 8:29 pm
SQL 7.. then you need to go with Sanjays Answers...
Also include sysprocesses.
Maninder
www.dbanation.com
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply