Friday, September 9, 2011

SQL Server 2005 Locking Hints

ROWLOCK : Use row-level locks when reading or modifying data.
PAGLOCK : Use page-level locks when reading or modifying data.
TABLOCK : Use a table lock when reading or modifying data.
DBLOCK : Use a database lock when reading or modifying data.
UPDLOCKUPDLOCK reads data without blocking other readers, and update it later with the assurance that the data has not changed since last read.
XLOCKUse exclusive locks instead of shared locks while reading a table, and use hold locks until the end of the statement or transaction.
HOLDLOCKUse a hold lock to hold a lock until completion of the transaction, instead of releasing the lock as soon as the required table, row, or data page is no longer required.
NOLOCKThis does not lock any object. This is the default for SELECT operations. It does not apply to INSERT, UPDATE, and DELETE statements.

No comments: