k-World

Archive for January, 2015

SQL – NO LOCK & READUNCOMMITTED

Sql NO LOCK is used only with the SELECT statements, it helps us to read the un-commited data thus helps in preventing the deadlocks.

Using Sql NO LOCK:

SELECT * FROM CUSTOMERS WITH (NOLOCK) WHERE CUSTOMERNAME = ‘JASON’

Similar NO LOCK can also be written as below:

SELECT * FROM CUSTOMERS WITH (READUNCOMMITTED) WHERE CUSTOMERNAME = ‘JASON’