Current transaction ID in an audit trigger

后端 未结 5 1428
情书的邮戳
情书的邮戳 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条回答
  •  猫巷女王i
    2020-12-15 11:02

    From SQL Server 2008, Microsoft introduced sys.dm_exec_requests, which is to deprecate sys.sysprocesses. This view returns the transaction_id, and can be called without granting VIEW SERVER STATE. Like sys.sysprocesses, it returns details for the current process if VIEW SERVER STATE is not granted, and all processes if it is.

提交回复
热议问题