SQL Flow Field Guide

CURRENT_TRANSACTION_ID

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

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.