Skip to main content

Posts

Showing posts from April, 2011

To view any Open Transactions

This is quite a prevalant scenario for any DBA that would use begin tran to update a column as per requirement. If there isn't an instruction to the Storage Engine to either commit the transaction or roll it back, it would lead to a situation that would swamp the transaction log file which would slow down the system that would access the database. If that is the case, one can check for open transactions through the below command dbcc opentran This would show the process id if any transaction is open. Then the details related to open transaction can be fetched from one of the below system objects. exec sp_who or select * from sys.sysprocesses A column called sqlhandle can be useful to know the query being executed by the process. If the results produced through any updates are favourable, its better commit as soon as possible and if not roll it back.