Altering Views with T-SQL

The ALTER VIEW syntax follows:

ALTER VIEW [ schema_name . ] view_name [ ( column [ ,...n ] ) ][ WITH <view_attribute> [ ,...n ] ]AS select_statement [ ; ][ WITH CHECK OPTION ]<view_attribute> ::={    [ ENCRYPTION ]    [ SCHEMABINDING ]    [ VIEW_METADATA ]}

The ALTER VIEW statement utilizes the same set of options and parameters as the CREATE VIEW statement. You should consider using the ALTER VIEW statement when making changes to your view instead of dropping and re-creating the view. Altered views retain their associated permissions and do not affect dependent stored procedures or triggers.

An example of the ALTER VIEW statement follows:

 ALTER VIEW [dbo].[vw_employee] ...

Get Microsoft SQL Server 2014 Unleashed 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.