Jesalcv
Jesalcv

Reputation: 517

Queuing mechanism to control table transactions

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

Answers (1)

Alberto Morillo
Alberto Morillo

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

Related Questions