문제

I have some ad-hoc reporting users hitting some SQL Server views. Occasionally the read locks taken by these users for particularly lengthy queries causes 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top