Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

How to get a really unique transaction id in SQL Server?

$
0
0

For auditing reasons I have to determine the current transaction's unique id. 

Using sys.dm_exec_requests.transaction_id (or sys.dm_tran_current_transaction.transaction_id) doesn't work for me because transaction_id restarts at 0 after a server restart.

Is there another transaction id, that is really unique (DB scope)? Or is there another reliable value that I could use to combine the transaction_id with, like for instance the time when the transaction_id counter was reset?

 

Thanks!



Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>