Summary of SQL Server views
The view is stored on the physical table, changed by the physical table changes, generally no longer need to update.
View as a filter: you can see from the filter name that the main purpose of such a view is to hide, as a hidden SELECT statement.
One of the more important details in the view is that, in many updates, you need to add the "checkwith option" statement (the Where condition is required for UPDATE, INSERT, delete) to ensure the integrity of the data.
In addition: In most databases, the use of views as a tool is often not too much or too little. Some people like to use views to abstract almost everything (while doing this means adding a layer of processing). Others seem to forget that the view is also an option. The view should be used at the right time to get better results.
In the process of using a view, several aspects should be noted:
1. Avoid building views based on views-instead, apply the appropriate query information from the first view to the new view.
2. Remember to use the view with CHECK option to provide flexibility that is not available with some different check constraints.
3. View encryption-The encrypted view is no longer able to recover unencrypted code.
4. In addition to the permissions, the use of Alter view means that the existing view is completely replaced. This means that if the encryption and restrictions in the modified view are still valid, the withencryption and withcheck option clauses must be included in the ALTER statement.
5. Use sp_helptext to display the support code for the view--Avoid using system tables.
6. Minimize the users of the view used for production queries-because they add additional overhead and compromise performance.
General usage of Views:
1. Filter line
2. Protection of sensitive data
3. Reduce database complexity
4. Abstract multiple physical databases into one logical database