Summary

SQL Server balances concurrency, performance, and lock overhead in the way that it defines locks. You can manipulate locks with locking hints to influence the kinds of locks your process obtains. In tomorrow's lesson, you will learn to use transactions to group statements and improve error handling. Once again, here are a few Do's and Don'ts for you to use:

DO DON'T
DO DON'T
Use dirty reads to get quick, approximate results. Overuse lock hints.
Use lock hints and isolation levels to improve performance. Use serializable and repeatable read too often—they lead to deadlocks.
Write data first, and then read it, to avoid deadlocks.  
Test for deadlocks in your programs.  

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.