Last post May 21, 2015 04:15 AM by PatriceSc
May 20, 2015 12:01 PM|gunderj|LINK
Does someone have a query that lists what stored procedures are currently running? My search for this seems to provide everything except which SP's are
currently actively running (invoked by SSMS, an application, or whatever)
May 20, 2015 12:12 PM|PatriceSc|LINK
Have you tried
http://www.sqlservercentral.com/Forums/Topic813548-146-1.aspx ? You may want to explain your final goal.
May 20, 2015 04:24 PM|gunderj|LINK
Thanks but this just shows the sql running, not the stored procedure name - which is surprising since exec my_sp is just sql and should show in this result set. Sadly, it does not. My purpose is I want the stored procedure to first check if it is already
running if true, then stop and do not run. It can be submitted from multiple sources - the front end app, SSMS job scheduling and other possible sources.
Seems like someone must have solved this one. Hope.
May 21, 2015 04:15 AM|PatriceSc|LINK
You get the object id from the joined query so you should be able to get all proc names.
If you want to do that for a particular stored procedures it seems a bad way to do that. It is still not what I would call the final goal. It would seem rather that you need to implement some kind of locking scheme (maybe