Microsoft SQL Server 2014 Unleashed
by Ray Rankins, Paul Bertucci, Chris Gallelli, Alex T. Silverstein
Serializable Read Isolation
Serializable Read mode is similar to repeatable reads but adds to it the restriction that rows cannot be added to a result set that was read previously within a transaction. This prevents phantom reads. In other words, Serializable Read locks the existing data being read as well as rows that do not yet exist. It accomplishes this by locking the data being read as well as locking across the range of values being read so that additional rows cannot be added to the range.
For example, say you run a query in a transaction that retrieves all records from the Sales.SalesOrderHeader table in the AdventureWorks2012 database for a Customer with the CustomerID of 11300. To prevent additional records from being added to the ...
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