CURRENT_TRANSACTION_ID (Transact-SQL)
Applies to:
SQL Server 2016 (13.x) and later
Azure SQL Database
Azure SQL Managed Instance
This function returns the transaction ID of the current transaction in the current session.
Transact-SQL syntax conventions
Syntax
CURRENT_TRANSACTION_ID( )
Return types
bigint
Return Value
The transaction ID of the current transaction in the current session, taken from sys.dm_tran_current_transaction (Transact-SQL).
Permissions
Any user can return the transaction ID of the current session.
Examples
This example returns the transaction ID of the current session:
SELECT CURRENT_TRANSACTION_ID();
See also
sp_set_session_context (Transact-SQL)
SESSION_CONTEXT (Transact-SQL)
Row-Level Security
CONTEXT_INFO (Transact-SQL)
SET CONTEXT_INFO (Transact-SQL)
प्रतिक्रिया
https://aka.ms/ContentUserFeedback.
जल्द आ रहा है: 2024 के दौरान हम सामग्री के लिए फीडबैक तंत्र के रूप में GitHub मुद्दों को चरणबद्ध तरीके से समाप्त कर देंगे और इसे एक नई फीडबैक प्रणाली से बदल देंगे. अधिक जानकारी के लिए, देखें:के लिए प्रतिक्रिया सबमिट करें और देखें