CREATE VIEW#
Creates a view — a virtual table whose contents are defined by a query.
Syntax#
Arguments#
view name
The name by which the view is identified within the virtual database.
select
A SELECT query that defines the rows and columns the view exposes.
Examples#
Create a view that exposes only the active products:
CREATE VIEW dbo.ActiveProduct AS
SELECT Id, Name, Price
FROM dbo.Product
WHERE Discontinued = 0;
See also