Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top