Introduction to SQL Server view (view) _mssql2005

Source: Internet
Author: User
Tags management studio sql server management sql server management studio

A view is a common database object that stores the results of a query as a virtual table in the data. Because the view has a lot of advantages: 1, you can simplify the operation, 2, you can set up front and back buffer, 3, you can merge the split data, 4, the most important thing is to improve security, so in the SQL view also occupies a very important position. In this chapter's summary, profoundly realizes, two kinds of methods: 1, Enterprise Manager, 2,t-sql statement to manage the view, and four kinds of operations: 1, increase, 2,, delete, 3, change, 4, check.

In Enterprise Manager, and now in SQL Server Management Studio, to perform these operations, in fact, are similar! For example, to create a view, right-click on the view, and then create a new view, there will be wizards, very simple answer!

The bottom line focuses on the summary of these operations using T-SQL statements:

Here I give an example of creating a view:

Example: Create a view in the company database that requires the results returned by the view to include the information item name, customer name, employee name, start date, and estimated duration.

Use company CREATE View project information view as select a. Project name, B. Customer name, C. Name, a, start date, a. Estimated duration from project as a inner join customer as B on a. Customer number =b. Customer number Innerjoin employee as C Where A. Customer number =b. Customer number and a. Owner number =c. Number Go


Of course, we can also do some action on the data in the table through the view:

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.