Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How does rollback really work? Expand / Collapse
Author
Message
Posted Thursday, September 27, 2012 5:22 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, November 13, 2014 7:38 AM
Points: 40, Visits: 160
When you rollback a transaction, how does sql know what to rollback and indeed what data to replace it with?

A proper technical answer please.



Post #1365150
Posted Thursday, September 27, 2012 7:15 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 2:01 PM
Points: 40,404, Visits: 36,849
The short answer:

SQL reads back over the transaction log entries for the transaction that needs to be rolled back and generates compensating operations (operations that reverse the effect of each logged change) which it then logs and executes.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1365229
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse