Reputation: 517
Is there any mechanism to queue up the actions over a table into a queue and which can be processed using a procedure? Say I have 5 transactions that need to be performed over a table as one after another but we have to manage it in such a way that only after the first transaction completion the second one is invoked.
Upvotes: 0
Views: 84
Reputation: 15684
You can use app locks for this.
BEGIN TRAN
EXEC sp_getapplock 'foo', 'exclusive'
They are fast and you can release app locks when you're done, even in the middle of a transaction. Please read more about it here.
Upvotes: 3