The difference is that you should be using the syntax WITH (NOLOCK)
(or WITH (<any table hint>)
). Why?
Without
WITH
is deprecated. From Table Hints on MSDN:from table1 nolock
does not apply a hint at all - that's an alias. For example:SELECT nolock.name FROM sys.objects nolock ORDER BY nolock.name;
Notice that I can use
nolock
as an alias. No hint is applied here.from table1 as mytable nolock
is invalid syntax in modern versions of SQL Server.