Current transaction ID in an audit trigger

后端 未结 5 1420
情书的邮戳
情书的邮戳 2020-12-15 10:49

I was looking at storing some form of transaction id from an audit trigger. The solution appeared to be to use sys.dm_tran_current_transaction as in this post SQL Server Tri

5条回答
  •  北海茫月
    2020-12-15 11:22

    Starting with SQL Server 2016, you could use CURRENT_TRANSACTION_ID. According to the docs:

    Any user can return the transaction ID of the current session.

提交回复
热议问题