Interview Question of the Week #035 – Different Ways to Identify the Open Transactions

Question: What are different ways to identify open transactions in SQL Server?

Answer: There are many ways to identify the open transactions. If there are some transactions which were started and not yet committed or rollback, you can use any of these to find them

Use DBCC command

There is a specific DBCC command for this.

DBCC OPENTRAN

Use SYS.SYSPROCESSES view

SELECT * FROM SYS.SYSPROCESSES WHERE OPEN_TRAN = 1

This will list out more details about the open transactions

Use SYS.DM_TRAN_SESSION_TRANSACTIONS view

SELECT * FROM SYS.DM_TRAN_SESSION_TRANSACTIONS

Reference: Pinal Dave (https://blog.sqlauthority.com)

Solarwinds
Previous Post
SQL SERVER – How to Enable or Disable All the Triggers on a Table and Database?
Next Post
SQL SERVER – Identify Time Between Backups Calculation

Related Posts

No results found

Leave a Reply

Menu