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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.