Difference between Read Uncommitted and Nolock - SQL server
The
read-uncommitted
isolation level is the least restrictive isolation level within SQL Server, which is also what makes it popular for developers when looking to reduce blocking.
The
nolock
table hint behind the scenes performs the exact same action as running under the read-uncommitted isolation level.
The only difference between the two is that the
read-uncommitted
isolation level determines the locking mechanism for the entire connection and the nolock
table hint determines the locking mechanism for the table that you give the hint to.
Sample:
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT *
FROM Table1 T1
INNER JOIN Table2 T2 ON T1.ID = T2.id
It is functionally equivalent to:
SELECT *
FROM Table1 T1 WITH(NOLOCK)
INNER JOIN Table2 T2 WITH(NOLOCK) ON T1.ID = T2.ID