Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

DROP INDEX

Description

Deletes an index on the specified table.

Syntax

DROP INDEX [IF EXISTS] [index_owner_name.]index_name

[ON [table_owner_name.]table_name]

Arguments

[IF EXISTS]

This argument avoids failure by attempting to drop the index only if an index of that name already exists.

index_owner_name

If index_owner_name is specified and is different from the name of the user executing the statement, then the user must have DBA privileges.

table_name

The table_name argument is optional. If specified, the index_name is verified to correspond to the table.

Warning: Do not DROP indexes on primary or foreign keys. This can lead to relational integrity issues. Use ALTER TABLE to perform any changes involving constraints.

Example

DROP INDEX custindex ON customer ;

Authorization

The user executing this statement must have any of the following privileges:

  • DBA privilege
  • Ownership of the index
  • EXCLUSIVE file access is required for any this operation

    SQL Compliance

    ODBC Core SQL grammar

    Environment

    Embedded SQL, interactive SQL, ODBC applications

    Related Statements

    CREATE INDEX

TOCIndex