Removes one or more views from the current database.
drop view [owner.]view_name [, [owner.]view_name] ...
is the name of the view to drop. Specify the owner’s name to drop a view of the same name owned by a different user in the current database. The default value for owner is the current user.
Removes the view new_price from the current database:
drop view new_price
When you use drop view, the definition of the view and other information about it, including privileges, is deleted from the system tables sysobjects, syscolumns, syscomments, sysdepends, sysprocedures, and sysprotects.
Existence of a view is checked each time the view is referenced, for example, by another view or by a stored procedure.
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for drop view differ based on your granular permissions settings.
Granular permissions enabled |
With granular permissions enabled, you must be the view owner or a user with drop any view privilege. |
Granular permissions disabled |
With granular permissions disabled, you must be the view owner or a user with sa_role. |
Values in event and extrainfo columns of sysaudits are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
33 |
drop |
drop view |
|
Commands create view
System procedures sp_depends, sp_help, sp_helptext