CURRENT_TRANSACTION_ID
reads transaction state
What changes
- Input
- current transaction
- Output or change
- transaction id
- Return type
- bigint
Syntax at a glance
CURRENT_TRANSACTION_ID( )
Work example
Read the current transaction id while tracing transaction context.
Read state in the intended scope and immediately after the statement it describes. Treat host values as untrusted.
Check your work No active transaction means no current id and this value is not an application key.
Open Microsoft Learn for full syntax, permissions, and details for your version.