Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you find open transactions on Windows Azure SQL Database?

In SQL Server 2008 R2 you can use the following to find all open transactions when debugging deadlocks:

DBCC OPENTRAN 

However that functionality is not available in Windows Azure SQL Database; it instead throws the errors:

"DBCC command 'OPENTRAN' is not supported in this version of SQL Server."

The sp_who2 stored procedure doesn't exist either.

What is the correct query for getting all open transactions within the Azure version of SQL Server?

like image 200
Luke Merrett Avatar asked Oct 23 '25 19:10

Luke Merrett


1 Answers

Try using the DMVs instead:

SELECT *
FROM sys.dm_tran_active_transactions

SELECT *
FROM sys.dm_tran_database_transactions

SELECT *
FROM sys.dm_tran_session_transactions
like image 126
JuneT Avatar answered Oct 26 '25 09:10

JuneT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!