If you include a NOLOCK
hint on a select from a VIEW
, does that NOLOCK
hint propagate down into the tables joined within the view? If not, what's the purpose of locking a view?
Sample view code:
CREATE VIEW [my_custom_view] AS SELECT a1.[column_a], a1.[column_b], a1.[column_c], a1.[column_d] FROM [table_a] a1 JOIN [table_b] b1 ON b1.[column_a] = a1.[column_b]
And the NOLOCK statement:
SELECT [column_a], [column_b] FROM [my_custom_view] NOLOCK
Yes, it does.
Using WITH NOLOCK Table Hint in Query Using View - Does it Propagate Within the View?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With