Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

READ uncommitted vs. NOLOCK 1

Status
Not open for further replies.

vadimg

IS-IT--Management
Oct 25, 2001
152
US
not sure where to post this: administration or programming.. i posted it in both...


hi!

I need a select to read uncommitted data, but due to some silly (stupid) application restrictions, I cannot set 'transaction isolation level read uncommitted' for any session. (don't ask why .. it's a long story, and i'm not happy about it ;0(....

I'd like to use NOLOCK to force dirty reads.
What is the difference b/w using 'read uncommitted' and NOLOCK? Looks like both can read uncommitted data, and for a few queries i tested, looks like both use the same execution plans (which is critical in my situation).

any pitfalls? things to watch out for??

THANKS MUCH!

 
BOL installed says "READUNCOMMITTED Equivalent to NOLOCK."
if you look at


it say
"NOLOCK Equivalent to READUNCOMMITTED. For more information, see READUNCOMMITTED later in this topic."
and
"READUNCOMMITTED Specifies that dirty reads are allowed. This means that no shared locks are issued and no exclusive locks are honored. Allowing dirty reads can result in higher concurrency, but at the cost of lower consistency. If READUNCOMMITTED is specified, it is possible to read an uncommitted transaction or to read a set of pages rolled back in the middle of the read; therefore, error messages may result. For more information about isolation levels, see SET TRANSACTION ISOLATION LEVEL."

the difference is NOLOCK/READUNCOMMITTED is a granularity hints or table level locking and preform identically. They are just aliases for the same functionality.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top