This function returns the transaction ID of the current transaction in the current session.
Transact-SQL Syntax Conventions
bigint
The transaction ID of the current transaction in the current session, taken from sys.dm_tran_current_transaction (Transact-SQL).
Any user can return the transaction ID of the current session.
This example returns the transaction ID of the current session:
sp_set_session_context (Transact-SQL)
SESSION_CONTEXT (Transact-SQL)
Row-Level Security
CONTEXT_INFO (Transact-SQL)
SET CONTEXT_INFO (Transact-SQL)