Sys.dm_tran_current_transaction. How unique is transaction_id

I take a transaction from sys.dm_tran_current_transaction in my audit triggers. What I would like to know is the uniqueness of transaction_id. The documentation only says "Transaction ID of the current snapshot."

I can only assume that this "identifier" will be reused later, but I would appreciate confirmation of this.

+5
source share
2 answers

@abcdefghi's answer is good, but just add to it;

  • Transaction_id in a transaction is the same,
  • outside of an explicit transaction, transaction_id updates for each batch,
  • transaction_id , , .

, transaction_id - ;

, _id = 42   sql reset ... 41 ...   , _id = 42

, transaction_id ( ), , .

+1

All Articles