Transaction Commands

Use the OPENTRAN command for information about transactions.

Syntax

DBCC OPENTRAN ({database_name} | {database_id}) [WITH TABLERESULTS] [,NO_INFOMSGS] 

The OPENTRAN command reports the oldest open transaction. An open transaction can stem from an aborted transaction, a runaway transaction, or poor transaction management. If necessary, you can terminate the offending transaction by issuing the KILL command with the process ID returned from the OPENTRAN command.

TIP

Long-running transactions can lead to contention for resources, which can lead to blocking. Use OPENTRAN to detect open transactions. If necessary, use the KILL command to cancel the transaction.

Example

DBCC OPENTRAN(pubs) 

Sample Output

 Transaction information ...

Get Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.