开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜