What Are Transactions?
Transactions allow you to define the boundaries of activity that will be considered atomic. You do so by enclosing the statements that you want to participate in the transaction in a BEGIN TRAN/COMMIT TRAN block. Note that in SQL Server the default behavior is to consider a statement that does not appear in an explicit transaction block to be its own transaction–as if you enclosed that statement alone in a BEGIN TRAN/COMMIT TRAN block.
Whenever you submit a change to the database, SQL Server first checks whether the pages that need to be affected already reside in cache. If they do, the pages are modified in cache. If they don’t, they’re first loaded from disk into the cache and modified there. SQL Server records the changes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access