I always thought that NOLOCK locking hint and SET
TRANSACTION ISOLATION LEVEL READ UNCOMMITTED are the same,
but have heard an opinion that READ UNCOMMITED allows to
read dirty data, but places the shared lock, an NOLOCK
does not place the shared lock. So, supposedly NOLOCK is
better in the cases where SELECT should not cause any
locks.
Is it true?
If I select data with READ UNCOMMITED, do I put still put
shared lock?
Thanks,
-StanHello Stan,
Thanks for using MSDN Managed Newsgroup.
(NOLOCK) hint and the READ UNCOMMITED isolation have the same
locking behavior. While Selecting (reading) the
data, they do not acquire the Shared Locks. The only difference is
(NOLOCK) should be used with every SELECT query where as
READ UNCOMMITED isolation level is in effect for the whole connection.
Does that answer your question ?
Vikrant Dalwale
Microsoft SQL Server Support Professional
Microsoft highly recommends to all of our customers that they visit
the http://www.microsoft.com/protect site and perform the three
straightforward steps listed to improve your computer?s security.
This posting is provided "AS IS" with no warranties, and confers no
rights.
>Content-Class: urn:content-classes:message
>From: "Stan" <nospam@.yahoo.com>
>Sender: "Stan" <nospam@.yahoo.com>
>Subject: Is there a difference between NOLOCK and SET TRANSACTION
ISOLATION..?
>Date: Fri, 9 Jan 2004 06:04:10 -0800
>Lines: 16
>Message-ID: <0afe01c3d6b9$743092a0$a301280a@.phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>thread-index: AcPWuXQwGhpIfFQsS/qGSPe3cR+CaQ==>Newsgroups: microsoft.public.sqlserver.server
>Path: cpmsftngxa07.phx.gbl
>Xref: cpmsftngxa07.phx.gbl microsoft.public.sqlserver.server:323548
>NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
>X-Tomcat-NG: microsoft.public.sqlserver.server
>I always thought that NOLOCK locking hint and SET
>TRANSACTION ISOLATION LEVEL READ UNCOMMITTED are the same,
>but have heard an opinion that READ UNCOMMITED allows to
>read dirty data, but places the shared lock, an NOLOCK
>does not place the shared lock. So, supposedly NOLOCK is
>better in the cases where SELECT should not cause any
>locks.
>Is it true?
>If I select data with READ UNCOMMITED, do I put still put
>shared lock?
>Thanks,
>-Stan
>|||>Does that answer your question ?
Yes, thanks!|||Since NOLOCK is a "Hint" isn't the Isolation Level Setting more reliable ?
Greg Jackson
PDX, Oregon
No comments:
Post a Comment