SQL Server database view

Source: Internet
Author: User

A large amount of data is stored in the database, but not all users can browse all data to ensure data security and convenience. To solve this problem, SQL server uses permissions, roles, and views. This blog introduces the view first.

Concept: A view is a virtual table generated from one or more associated tables. In other words, it is a virtual "table" composed of some data in one or more tables ".

Features:

1. Split the data to simplify the viewpoint: select and where statements are used to select the data you are concerned about and remove irrelevant data.

Ii. Simplified operations: A view can avoid table access and access operations, while a view is a good query window.

3. Data protection: Creates views for users and automatically blocks data outside permissions.

4. provide logical independence for Data Reconstruction: In relational databases, data reconstruction is inevitable. The most common is vertical split into twoSince the data type and value in the table have not changed, you only need to slightly modify the view definition to meet the requirements of the changed table.

5. Automatic update: When the database structure remains unchanged, if the data in the base table changes, it will be automatically reflected to the view.

Question: A view is an object and a "virtual table". It also features automatic update, which leads to my thoughts on view storage: A view is an object that indicates that a view is instantiated after it is created. It actually exists in the Database and does exist. But how can I explain it as a virtual table? First, it can only be stored as a result set, each open to open the result set, but so how to automatically update; or in the form of T-SQL statements, each open to execute a statement, in this way, the automatic update can be explained, but the problem is that the view may be a great waste of resources for each execution. Therefore, these two storage methods are not scientific.

I checked some information and consulted senior and senior students. The result was no result. However, after discussion, I think that the view should be stored in the form of a result set, and there is a mechanism similar to a trigger to update the content in the view from time to time. In this way, the nature and features of the view can be explained. Of course, this is just my inference. It is not a fact. I just want to find the answer.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.