Thursday, July 23, 2015

Lock Compatibility Chart in SSMS

Before going to isolation level, we have to know about various types of lock in SSMS because Locking facilities that preserve transaction isolation.

If a resource (data row/rows of table/tables) is already locked by another transaction, a new lock request can be granted only if the mode of the requested lock is compatible with the mode of the existing lock. If the mode of the requested lock is not compatible with the existing lock, the transaction requesting the new lock waits for the existing lock to be released or for the lock timeout interval to expire.

Microsoft provide Lock Compatibility chart given below.



















Now will know that how to read the chart from below picture.


so, for example

1. If we run Intent shared lock on a data row of a table and anther person want to shared lock of the same data row, it is possible no need to wait for Intent shared lock.

2. If we run Intent shared lock on a data row of a table and anther person want to exclusive lock of the same data row, then he/she has to wait till Intent shared lock job is over.

3. If we run shared lock on a data row of a table and anther person want to exclusive lock of the same data row, it is not possible at same time. then it has to wait till shared lock's job is over.

4. If we run exclusive lock on a data row of a table then none of the lock can be applied until exclusive lock's job is over.



For definition of this locks please visit

No comments:

Post a Comment