CREATE VIEW

A view is a virtual table that represents the data in one or more tables. You can use a view to prepackage a query to make it easy to use. You can also give different permissions to tables and views (in a database that provides that level of permission) to restrict access to the data. For example, supervisors might need to see some employee data but not salary information. You could create a view that selects the employee data except for the Salary field and give the supervisors access to that view instead of the entire Employees table.

The basic syntax for a CREATE VIEW statement is

CREATE VIEW view_name [(column_name, column_name, ...)] 
AS select_statement
				

The column_name values give the names the view will use for the values ...

Get Visual Basic® .NET Database Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.