Creating Views (Data Definition Guide)
Go Up to Working with Views
The CREATE VIEW
statement creates a virtual table based on one or more underlying tables in the database. You can perform select, project, join, and union operations on views just as if they were tables.
The user who creates a view is its owner and has all privileges for it, including the ability to GRANT
privileges to other users, triggers, and stored procedures. A user can be granted privileges to a view without having access to its base tables.
The syntax for CREATE VIEW
is:
CREATE VIEW name [(view_col [, view_col …])] AS <select> [WITH CHECK OPTION];
- Note: You cannot define a view that is based on the result set of a stored procedure.