I'm working with an awful view which internally joins many, many tables together, some of which are the same table.
I'm wondering, when a table is being joined to itself, how is the NOLOCK
hint interpreted if it's on one of the joins and not the other? Is the NOLOCK
still in effect on the table, or is the table locked altogether if NOLOCK
is not included on one of the joins of the same table?
For example (this is pseduo-code, assume that there are valid JOIN ON
conditions):
SELECT *
FROM Table1 t1 (NOLOCK)
JOIN Table2 t2 (NOLOCK)
JOIN Table2_Table2 tt (NOLOCK)
JOIN Table2 t22 (NOLOCK)
JOIN Table1 t11
Does Table1
get locked or stay NOLOCK
ed?