I know that with(nolock)they (nolock)are the same or almost the same. REF: with (nolock) or (nolock) - Is there a difference?
with(nolock)
(nolock)
but what about nolock? You can use any of these in select, and the only noticeable difference that I see is to use an alias that you can write:
nolock
select
select * from table1 as mytable with(nolock)
or
select * from table1 as mytable (nolock)
but you cannot write:
select * from table1 as mytable nolock
PS : I do not discuss nolockgood or bad here :)
The difference is that you must use the syntax WITH (NOLOCK)(or WITH (<any table hint>)). Why?
WITH (NOLOCK)
WITH (<any table hint>)
WITH . MSDN:
WITH
WITH : Microsoft SQL Server. , .
from table1 nolock - . :
from table1 nolock
SELECT nolock.name FROM sys.objects nolock ORDER BY nolock.name;
, nolock . .
from table1 as mytable nolock SQL Server.
from table1 as mytable nolock
Msg 1018, 15, 1, 12"nolock". , A WITH . . SQL Server Books Online .
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED, , 15 WITH (NOLOCK), . (, RCSI, , READ UNCOMMITTED IMHO), - .
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
READ UNCOMMITTED
, , OP, , nolock, , :
:
WITH ( <table_hint> [ [, ]...n ] )
http://technet.microsoft.com/en-us/library/ms187373.aspx