22 November,2011 by Tom Collins
SQL Rollback Transaction is easy with sys.dm_exec_requests. The dynamic management view (DMV) sys.dm_exec_requests returns information about each request that is executing within SQL Server.
Instead of using Activity Monitor to view the status of a Rollback , use this T-SQL code.
Activity monitor is based on window panes and is cumbersome to export any information.
Using t-sql allows extra flexibility in reporting.
Note (13 th Sept,2019 ) - Matthias in comments below suggested to add der.reads and der.writes as part of the recordset. This will assist in presenting a more granular breakdown of Rollback progress - so even though it percentage complete may be on certain % - the reads and writes will continue to change
select der.session_id, der.command, der.status, der.percent_complete, der.reads, der.writes from sys.dm_exec_requests as der where command IN ('killed/rollback','rollback')
SQL Server - Predict SQL BACKUP DATABASE finish time with sys.dm_exec_requests
Predict ALTER INDEX REORGANIZE finish time
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |