0

We know that we can use table hints when selecting records in our own queries.

my question is:

when we create a view and use table hints such as "Nolock", "Holdlock", etc ... and then save the view in SQL server, does the table hint we used affect the view?

gbn
  • 422,506
  • 82
  • 585
  • 676
odiseh
  • 25,407
  • 33
  • 108
  • 151

1 Answers1

2

Yes. Any hints in the view affect how it's used.

Note: a table hint on a view propagates as well

SELECT * FROM MyView WITH (NOLOCK)-- hint applies to base tables too
gbn
  • 422,506
  • 82
  • 585
  • 676