DROP INDEX Statement

Removes the specified index from a table.

Category: Data Definition
Supports: EXECUTE Statement.
Data source: SAS data set, SPD Engine data set, Aster, DB2 under UNIX and PC, Greenplum, MDS, MySQL, ODBC, Oracle, PostgreSQL, SAP HANA, Sybase IQ, Teradata

Syntax

DROP INDEX index [FROM table] [FORCE];

Arguments

index

specifies the name of the index to be removed.

FROM table

specifies the name of the table where the index resides.

Requirements For a SAS data set, SPD Engine data set, and MDS table, you must include the FROM table syntax in order to specify the name of the table where the index resides.
For all data sources, you must include the FROM table syntax if you connected to the data source using a data source name (DSN) that has SAS security enabled.

FORCE

specifies that the index is removed without error processing. Use the FORCE keyword only when you are certain that removing the index without error processing will not negatively impact the table.

Details

If you drop a composite index, then the index is removed for all the columns that are named in that index.
Note: The DROP INDEX statement does not apply to indexes that were created by using the PRIMARY KEY or UNIQUE constraints of either the CREATE TABLE or ALTER TABLE statements, respectively. To remove those indexes, you must first remove the constraint by using the ALTER TABLE statement.