Microsoft® SQL Server™ 2005 Administrator's Companion
by Edward Whalen, Marcilina Garcia, Burzin Patel, Stacia Misner, Victor Isakov
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 ...
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