view

xiaoxiao2021-03-06  106

Views are used as security tools and provide developers with different appearances of databases.

The view is a logical table instead of a physical table. It defines one or more physical tables as a SELECT statement query. Below is the code for creating a view.

Create View EmployeesandORDERS_2

AS

Select Employees.employeeID, Employees.lastname, Employees.Firstname, Orders.Orderid

From Employees Inner Join

Orders on Employees.employeeiD = Orders.employeeid

WHERE EMPLOYEES.EMPLOYEEID = 2

Characteristics of the view:

1. The view connects the columns in multiple tables so that they look like a table; can be used in a similar table, but in fact, the data of the configuration view is not stored in the form of the database, because they actually It is data stored in several tables stored in the database.

2. Using views can limit users to specific rows and specific columns in the table, that is, restricting users to view data, they do not have power to see data.

The View "can be made to the view at the Views node under Server Explorer.

The most important advantage of the view is that we can do things on the basis of the view. The view itself uses like a "table". For example, you can construct a query on the basis of the view.

SELECT * FROM

EmployeesandORDERS_2

转载请注明原文地址:https://www.9cbs.com/read-122956.html

New Post(0)