If a "WITH NOLOCK" query hint is used on a View in SQL Server, does it propagate that hint to the view definition itself, even if NOLOCK is NOT used for the raw tables in the View definition? The reason to need this is that sometimes the support staff wants to do huge time-consuming queries but would rather not force this lock on all queries using the view within the application itself.
Sql – Using WITH NOLOCK Table Hint in Query Using View – Does it Propagate Within the View
lockingsqlsql-server
Best Solution
Yes, NOLOCK will propagate to the tables used by the view definition (at least in SQL Server 2005).
See Table Hints in MSDN:
However,
If you're using indexed views you might want to read a bit more as there are some special cases there too.
Also see View Resolution for more info.