Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Syncronized stored procedure

Author  Topic 

dve
Starting Member

19 Posts

Posted - 2005-08-26 : 16:35:55
Hi,

Is it possible to syncronize access to a stored procedure in SQL server?

In other words; is it possible to have only one session execute a specific stored procedure at a time?

Say it takes a sproc 1 sec to execute and session 1 calls it. Then half a second later another session calls the sproc. Is it possible for the 2nd session to wait until the 1st has completed?


Thanks!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-08-26 : 16:38:15
You'd have to write logic to handle this. Perhaps you'd store the fact that it's in use in a table and then in the stored procedure you'd check it.

Tara
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-08-26 : 16:39:44
But that defeats the purpose and would create a potentially HUGE bottleneck....

Why do you wan to do this?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

dve
Starting Member

19 Posts

Posted - 2005-08-26 : 16:47:54
Because I need SQL server to give me unique numbers; see http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54420

Go to Top of Page
   

- Advertisement -