O'Reilly logo

Microsoft® SQL Server™ 2005 Administrator's Companion by Victor Isakov, Stacia Misner, Burzin Patel, Marcilina Garcia, Edward Whalen

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

Locking Hints

Locking hints are T-SQL keywords that can be used with SELECT, INSERT, UPDATE, and DELETE statements to direct SQL Server to use a preferred type of locking behavior for locks on a particular table or view. Locking hints on views are propagated to all the tables and/or views that are referenced by that view. You can use locking hints to override the default transaction isolation level. You should use this technique only when absolutely necessary because if you’re not careful, you could cause blocking or deadlocks.

The following list describes the available table-level locking hints:

  • HOLDLOCK. Holds shared locks until the completion of a transaction rather than releasing them as soon they are no longer needed. Equivalent to using the ...

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