DSV (Named Query) vs. Database View

By : Ganesha
Source: Stackoverflow.com

Please provide guidelines on when to use DSV's as opposed to database views. Any performance issue using one vs. the other?

Environment: SQL Server 2008

By : Ganesha


The only real difference is that you can index a view, so you can get better performance out of it. I really only throw a view onto the DB if it's for SSRS, though. If it's for SSAS and it's processing nightly, I define the query inside SSAS, just so that it's all in one place. Also, it's a lot easier to version the DSV than it is the view in the database, so if you need to revert your changes, that's easy to do.

Therefore: If performance is most important, use a view. If maintainability is most important, use a named query. That's my rule of thumb, at least.

By : Eric

This video can help you solving your question :)
By: admin