June 2015
Intermediate to advanced
1800 pages
70h 6m
English
The CREATE VIEW statement is used to create views with T-SQL. The syntax for the CREATE VIEW statement follows:
CREATE VIEW [ schema_name . ] view_name [ (column [ ,...n ] ) ][ WITH <view_attribute> [ ,...n ] ]AS select_statement [ ; ][ WITH CHECK OPTION ]<view_attribute> ::={ [ ENCRYPTION ] [ SCHEMABINDING ] [ VIEW_METADATA ] }
This statement and the related options are the same in SQL Server 2014 as they were in SQL Server 2012 and prior versions. We first look at a simple example for creating a view with T-SQL and then delve into several other examples that utilize the view attributes. Listing 24.2 shows a sample T-SQL statement for creating a simple view.
LISTING 24.2
Read now
Unlock full access