Thursday, October 1, 2015

How to find open transactions in SQL Server

DBCC OPENTRAN (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview
DBCC OPENTRAN helps to identify active transactions that may be preventing log truncation. DBCC OPENTRAN displays information about the oldest active transaction and the oldest distributed and nondistributed replicated transactions, if any, within the transaction log of the specified database. Results are displayed only if there is an active transaction that exists in the log or if the database contains replication information. An informational message is displayed if there are no active transactions in the log.