O'Reilly logo

Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition by Mark Spenik, Orryn Sledge

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Locks

SQL Server uses locks to maintain data consistency in a multiuser environment. SQL Server automatically handles locking behavior, and starting with SQL Server 7.0, locking automatically escalates and de-escalates on an as-needed basis.

To help understand why locks are important, look at the banking example shown in Figure 20.1. Suppose that you decide to transfer $100 from checking to savings. Your bank decides to run a report that shows your combined balance for checking and savings. What happens if the report is run while the transfer is in progress? Would the report show a balance of $200 or $100?

Figure 20.1. How locks maintain data consistency.

The answer resides in how SQL Server uses locks to maintain data consistency. When the transaction ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required