cancel
Showing results for 
Search instead for 
Did you mean: 

Any SQL gurus out there?

Anonymous
Not applicable

Any SQL gurus out there?

I was wondering if there was anyway you can determine if a given procedure is running on a SQL Server Instance? (In this case SQL Server 2014 Enterprise Edition)
For example I have Procedure XXX that can take anything up to N minutes to complete. However when this procedure is running I do not want any other users to be able to execute it. I know I could set a flag in a table to say that this procedure is running, but this approach falls down in the event of a system failure.
In an ideal world it would be a real time way of knowing if the procedure was running. Maybe this can be done using the system catalogues I don't know, which is why I am asking those that might.
2 REPLIES 2
jelv
Seasoned Hero
Posts: 26,785
Thanks: 971
Fixes: 10
Registered: ‎10-04-2007

Re: Any SQL gurus out there?

Anonymous
Not applicable

Re: Any SQL gurus out there?

It certainly does and a lot more elegant than other options I found, thank you for that, very much appreciated.