views:

81

answers:

1

hi

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?

+1  A: 

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
even if we have gathered records from other server and other DB?
odiseh
With linked servers etc? Sorry, I don't know. Other DBs on the same server: probably yes
gbn
thanks any way gbn.
odiseh