where DBCC OPENTRAN() will use ?

1.To find out any open transaction present or not in a database in sql.

2.Before Database shrink operations.

DBCC OPENTRAN()

Result:

Transaction information for database 'master'.
Oldest active transaction:
SPID (server process ID) : 52
UID (user ID) : -1
Name          : user_transaction
LSN           : (518:1576:1)
Start time    : Jun  1 2004  3:30:07:197PM
SID           : 0x010500000000000515000000a065cf7e784b9b5fe77c87709e611500
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
or

Result

No active open transactions.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

Let me know any other use?

Comments

Popular posts from this blog

SSIS2008R2 Error: 0xC0209303 at Package:

SQL2008R2 Error: The remote copy of database "XXXXX" has not been rolled forward to a point in time that is encompassed in the local copy of the database log. (Microsoft SQL Server, Error: 1412)