SET LOCK_TIMEOUT, NOLOCK and NOWAIT Hints – SQL SERVER

SET LOCK_TIMEOUT:  Specifies the number of milliseconds a statement waits for a lock to be released.

————————————————————————————————————————-

The behavior of NOLOCK and NOWAIT is absolutely opposite to each other but there is no guarantee to get the
valid answer in either of them.

NOWAIT will return ERROR if the original table has (transaction) locked on it.
NOLOCK will read the data irrespective of the (transaction) lock on it. It won’t give ERROR.

Link-I

Link-II

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s