-
T-SQL thread control
I want to prevent more than one client application calling a stored procedure at any 1 point in time. At the moment I do this using following T-SQL:
create proc etc...
begin tran
select * from table_X with (tablockx)
...rest of code.
commit tran
return(0)
The select statement places exclusive lock on table_X forcing all other calls to this stored procedure to wait until they can claim their own exclusive lock.
Is there a neater way of synchronising threads in T-SQL ??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|