| title | CURRENT_TRANSACTION_ID (Transact-SQL) | Microsoft Docs | ||||
|---|---|---|---|---|---|
| ms.custom |
|
||||
| ms.date | 12/18/2015 | ||||
| ms.prod | sql-non-specified | ||||
| ms.reviewer | |||||
| ms.suite | |||||
| ms.technology |
|
||||
| ms.tgt_pltfrm | |||||
| ms.topic | language-reference | ||||
| f1_keywords |
|
||||
| helpviewer_keywords |
|
||||
| ms.assetid | 82cd9f92-d935-45a0-a433-620d6e15b467 | ||||
| caps.latest.revision | 6 | ||||
| author | BYHAM | ||||
| ms.author | rickbyh | ||||
| manager | jhubbard |
[!INCLUDEtsql-appliesto-ss2016-asdb-xxxx-xxx_md]
Returns the transaction ID of the current transaction in the current session.
Transact-SQL Syntax Conventions
CURRENT_TRANSACTION_ID( )
bigint
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.
The following example returns the transaction ID of the current session:
SELECT CURRENT_TRANSACTION_ID();
sp_set_session_context (Transact-SQL)
SESSION_CONTEXT (Transact-SQL)
Row-Level Security
CONTEXT_INFO (Transact-SQL)
SET CONTEXT_INFO (Transact-SQL)