Reputation: 13
In Non-Azure, I can get the current transaction details by using following query but the support to this view is removed from SQL Azure and I did not find anything similar which can tell me current transaction Id.
select * from sys.dm_tran_current_transaction
Upvotes: 1
Views: 1045
Reputation: 2005
Is this not a more correct way of doing this
SELECT CURRENT_TRANSACTION_ID()
From
Upvotes: 0
Reputation: 777
I had the exact same issue and I was able to solve it using the following SQL statement in my trigger
select @TransactionId = transaction_Id from
sys.dm_tran_session_transactions
where session_id = @@spid
This seems to give me what I was looking for and I hope it will help you.
Upvotes: 1