Intent shared (IS) Protects requested or acquired shared locks on some (but not
all) resources lower in the hierarchy.
Intent exclusive (IX) Protects requested or acquired exclusive locks on some (but
not all) resources lower in the hierarchy. IX is a superset of IS, and it also
protects requesting shared locks on lower level resources.
Shared with intent exclusive (SIX) Protects requested or acquired shared locks on
all resources lower in the hierarchy and intent exclusive locks on some (but
not all) of the lower level resources. Concurrent IS locks at the top-level
resource are allowed.
Intent update (IU) Protects requested or acquired update locks on all resources
lower in the hierarchy. IU locks are used only on page resources. IU locks are
converted to IX locks if an update operation takes place.
Shared intent update (SIU) A combination of S and IU locks, as a result of
acquiring these locks separately and simultaneously holding both locks. For
example, a transaction executes a query with the PAGLOCK hint and then
executes an update operation. The query with the PAGLOCK hint acquires
the S lock, and the update operation acquires the IU lock.
Update intent exclusive (UIX) A combination of U and IX locks, as a result of
acquiring these locks separately and simultaneously holding both locks.
Schema(Sch) Locks
Used when an operation dependent on the schema of a
table is executing.
There are two types of schema locks:
Schema stability lock (Sch-S): Used while generating
execution plans. These locks don't block access to the
object data.
Schema modification lock (Sch-M): Used while
executing a DDL statement. Blocks access to the object
data since its structure is being changed.
Bulk Update (BU)
This lock is applied when there is a bulk copying
of data and the TABLOCK is applied or the
table lock on bulk load table option is set using
sp_tableoption.
Bulk update (BU) locks allow multiple threads to
bulk load data concurrently into the same table
while preventing other processes that are not
bulk loading data from accessing the table.
Key-Range Locks
Key-Range locks are used by SQL Server to prevent phantom
insertions or deletions into a set of records accessed by a
transaction. Key-Range locks are used on behalf of
transactions operating at the serializable isolation level.
Shared Key-Range and Shared Resource (RangeS_S)
locks are used to indicate a serializable range scan.
Shared Key-Range and Update Resource (RangeS_U)
locks are used to indicate a serializable update scan.
Insert Key-Range and Null Resource (RangeI_N) locks
are used to test ranges before inserting a new key into an
index.
Exclusive Key-Range and Exclusive Resource
(RangeX_X) locks are used when updating a key in a range.
There are also Key-Range conversion locks.
Key-Range conversion locks include:
RangeI_S
RangeI_U
RangeI_X
RangeX_S
RangeX_U
Key-Range conversion locks are created when a Key-Range lock overlaps another
lock.
RangeI_S locks are used when RangeI_N lock overlap Shared (S) lock.
RangeI_U locks are used when RangeI_N lock overlap Update (U) lock.
RangeI_X locks are used when RangeI_N lock overlap Exclusive (X) lock.
RangeX_S locks are used when RangeI_N lock overlap RangeS_S lock.
RangeX_U locks are used when RangeI_N lock overlap RangeS_U lock.
Key-Range conversion locks are rarely used and can be observed for a short
period of time under complex circumstances.
Locking Hints
NOLOCK
HOLDLOCK
UPDLOCK
TABLOCK
PAGLOCK
TABLOCKX
READCOMMITTED
READUNCOMMITTED
REPEATABLEREAD
SERIALIZABLE
READPAST
ROWLOCK
XLOCK
What are Locking Hints???
PAGLOCK Use page locks where a single table lock would usually be taken.
TABLOCK SQL Server holds this lock until the end of the statement.
However, if we specify HOLDLOCK, the lock is held until the end of the
transaction.
TABLOCKX Use an exclusive lock on a table. This lock prevents others from
reading or updating the table and is held until the end of the statement or
transaction.
UPDLOCK Use update locks instead of shared locks
while reading a table, and hold locks until the end of the
statement or transaction. UPDLOCK has the advantage
of allowing us to read data (without blocking other
readers) and update it later with the assurance that the
data has not changed since you last read it.
http://www.mssqlcity.com/Articles/General/sql2000_locking.htm
http://www.mssqlcity.com/Articles/Adm/SQL70Locks.htm
http://msdn.microsoft.com/en-
us/library/aa213026%28v=SQL.80%29.aspx
http://articles.techrepublic.com.com/5100-10878_11-5181472.html
http://www.mssqlcity.com/Articles/Adm/LockView.htm
http://msdn.microsoft.com/en-us/library/ms191242.aspx