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: