Altering and Dropping Views

If you want to change the definition of a view, you can do so using the ALTER VIEW statement, or by dropping and re-creating the view. Views can be dropped using the DROP VIEW statement.

Altering Views

It is better to alter a view to change its definition than to drop and re-create the view; when you alter the view, the permissions that have been assigned are retained, and dependent objects such as INSTEAD OF triggers and stored procedures aren't affected. The ALTER VIEW statement accepts the same parameters and options as CREATE VIEW. The ALTER VIEW syntax is as follows:

ALTER VIEW owner.view_name [(column[,n])] 
[WITH {ENCRYPTION|SCHEMABINDING|VIEW_METADATA}[,n]]
AS
select_statement
[WITH CHECK OPTION]

Since the ...

Get Microsoft® SQL Server™ 2000 Unleashed, Second Edition 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.