drop index

Description

Removes an index from a table in the current database.

Syntax

drop index table_name.index_name 
	[, table_name.index_name] ...

Parameters

table_name

is the table in which the indexed column is located. The table must be in the current database.

index_name

is the index to drop. In Transact-SQL, index names need not be unique in a database, though they must be unique within a table.

Examples

Example 1

Removes au_id_ind from the authors table:

drop index authors.au_id_ind 

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

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

Granular permissions enabled

With granular permissions enabled, you must be the table owner .

Granular permissions disabled

With granular permissions disabled, you must be the table owner.

Auditing

Values in event and extrainfo columns of sysaudits are:

Event

Audit option

Command or access audited

Information in extrainfo

105

drop index

  • Roles – current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

  • Proxy information – original login name, if a set proxy is in effect

See also

Commands create index, setuser

System procedures sp_cursorinfo, sp_helpindex, sp_spaceused