开发者

Any issues with join hints in a SQL Server 2000 view?

开发者 https://www.devze.com 2022-12-08 20:50 出处:网络
I have some ad-hoc reporting users hitting some SQL Server views. Occasionally the read locks taken by these users for particularly lengthy queries caus开发者_开发问答es trouble elsewhere in the syste

I have some ad-hoc reporting users hitting some SQL Server views. Occasionally the read locks taken by these users for particularly lengthy queries caus开发者_开发问答es trouble elsewhere in the system.

I am considering adding some strategic with(nolock) hints to the views but wanted to know if there are any gotchas associated with hints in views.

Please ignore the obvious issues with letting users run queries this close to the SQL metal :).

Also, I know that nolock hints are an advanced feature not to be used lightly and I am well aware that they introduce fun things like dirty reads. Finally, if you're thinking that read_committed_snapshot makes sense here, I must sadly say that it's not available for 2000.


There is a potential for the report to show an inconsistent view of data. That kind of thing is rare, though.

Still, a better strategy is to use replication to create a completely separate reports database.

0

精彩评论

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