What are the advantages of using views. Why do we need
views when we have SPs?

Answer Posted / dr.job418

A view provides several benefits.

1. Views can hide complexity

If you have a query that requires joining several tables, or has complex logic or calculations, you can code all that logic into a view, then select from the view just like you would a table.

2. Views can be used as a security mechanism

A view can select certain columns and/or rows from a table, and permissions set on the view instead of the underlying tables. This allows surfacing only the data that a user needs to see.

3. Views can simplify supporting legacy code

If you need to refactor a table that would break a lot of code, you can replace the table with a view of the same name. The view provides the exact same schema as the original table, while the actual schema has changed. This keeps the legacy code that references the table from breaking, allowing you to change the legacy code at your leisure.

These are just some of the many examples of how views can be useful.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is data set in report?

112


What are the security related catalog views? : sql server security

699


What is sql server schema compare? How we can compare two database schemas?

766


How many types of cursor type are there?

753


what is database replicaion? : Sql server database administration

812






1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do

2249


According to you what goes into making the best database administrator? : sql server database administration

718


what is checksum in sql server.........???

1374


Do you know what is fill factor and pad index?

745


How do we know if any query is retrieving a large amount of data or very little data?

730


I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?

775


How ssrs maintain security?

775


What is the library index called?

773


Why I am getting "the microsoft .net framework 2.0 in not installed" message?

704


What is a database table?

695