Forum Discussion
SYSUTCTRANSBEGINTIME
sys.dm_tran_active_transactions has transaction_begin_time with DataType datetime on SQL Server, but I need datetime2(7)
So the Question is: is there a dm_tran_active_transactions-Column or function SYSUTCTRANSBEGINTIME with datetime2(7) in SQL Server 2025?
Regards Marcus
You can try converting the sys.dm_tran_active_transactions.transaction_begin_time column to UTC but you will NOT get the datetime2 output.
SELECT
transaction_id,
transaction_begin_time AS local_time,
DATEADD(
MINUTE,
DATEDIFF(MINUTE, SYSDATETIME(), SYSUTCDATETIME()),
transaction_begin_time
) AS transaction_begin_time_utc
FROM sys.dm_tran_active_transactions;
- MarcusMMJan 07, 2026Copper Contributor
I primary asked for datetime2(7), UTC is secondary ...
and the best solution would be a function, not a SELECT