SQL Server - how to set (nolock) hint as a default?
As others quite rightly say, a global (nolock) is done using READ UNCOMMITTED.
However, before going down that route, it's worth trying READ COMMITTED SNAPSHOT first. This means your reads won't be locked by in progress inserts / updates and means that the data isn't dirty, just out of date.
I think this is what you are looking for...
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
You want to use the following syntax:
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
I found this by looking at the NOLOCK table hint located here. The WITH(NOLOCK) table hint is equivalent to setting the isolation level to be READ UNCOMMITTED. Here's the snippet from MSDN:
NOLOCK Is equivalent to READUNCOMMITTED. For more information, see READUNCOMMITTED later in this topic.
found this....
How to force nolock hint for sql server logins
seems like the best way to achieve this is to issue a
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
any other idea???
ps
another related question...
NOLOCK vs. Transaction Isolation Level