Do table hints apply to all tables or only the preceding table?
If I have
select * from table开发者_运维问答A, tableB with (nolock)
does the nolock hint apply to tableB, or does it apply to both tables? Do I need to do
select * from tableA with (nolock), tableB with (nolock)
for the hint to apply to both tables?
Table hints only apply to the preceeding table. You need to do
select * from tableA with (nolock), tableB with (nolock)
Yes. Table Hints only apply to the preceding table. To set this for all tables in the query you could do.
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
NOLOCK
/ READ UNCOMMITTED
can cause inconsistent results however. Have you considered RCSI instead?
精彩评论