What are the advantages of using views. Why do we need
views when we have SPs?
Answers were Sorted based on User's Feedback
Answer / saurabh
View are the image of table.
advantages:- 1> they hide the details of table from which
they get data.
2> they are working as table and, provide security from
unautherized acccess.
3> they are read only.
4> they update automatically when some changes occurs in
original table
| Is This Answer Correct ? | 23 Yes | 3 No |
Answer / reddy
1) we can use views in sp instead of joins to increase the
performance of SP.
| Is This Answer Correct ? | 7 Yes | 1 No |
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 |
What are the different types of replication? How are they used?
how can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role? : Sql server administration
Explain primary key, foreign key and unique key?
What is a document index?
Find nth lowest salary or get nth lowest salary?
How can you know if the row fetched from cursor is still valid in underlying table?
HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE
What is the cpu pressure?
What is inline variable assignment?
How to delete an attribute from the emp table
what is a stored procedure and trigger?
what is physical sort data and logical sort data in index?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)