December 12, 2003 at 11:02 am
How do I determine if an SP is already running so I can prevent additional instances from running simultaneously? I know I could do it with a semaphore in the user database, but is there a better way?
December 12, 2003 at 11:53 am
There is code posted at another site that is supposed to return this information. I haven't tested it myself.
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=768&lngWId=5
December 12, 2003 at 12:57 pm
Thanks, Jonathan! I'll try it out.
December 15, 2003 at 1:35 am
You may use SQL Server's internal locking semaphores by using sp_getapplock and sp_releaseapplock. This way you can delay second execution of SP. You can even set a timeout to wait for execution of first instance.
December 15, 2003 at 3:56 pm
Thanks, jcool - I'll check this out too!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply