drop view

Removes one or more views from the current database.

Syntax

drop view [owner.]view_name [, [owner.]view_name] ...

Parameters

Examples

Usage

  • 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.

See also sp_depends, sp_help, sp_helptext in Reference Manual: Procedures.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

The permission checks for drop view differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be the view owner or a user with drop any view privilege.

Disabled

With granular permissions disabled, you must be the view owner or a user with sa_role.

Auditing

Values in event and extrainfo columns of sysaudits are:

InformationValues
Event

33

Audit option

drop

Command or access audited

drop view

Information in extrainfo
  • Roles – current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

Related reference
create view