Skip to Main Content
SQL in a Nutshell
book

SQL in a Nutshell

by Kevin Kline
December 2000
Intermediate to advanced content levelIntermediate to advanced
224 pages
9h 52m
English
O'Reilly Media, Inc.
Content preview from SQL in a Nutshell

Name

DROP INDEX

Synopsis

The DROP INDEX command destroys one or more indexes within the current database. When an index is dropped, all the space it previously consumed is immediately regained. DROP INDEX does not, however, destroy PRIMARY KEY or UNIQUE constraints, which must be done with the ALTER TABLE . . . DROP command. Refer to the CREATE TABLE command for more information about primary key and unique constraints.

Vendor

Command

SQL Server

Supported, with variations

MySQL

Supported, with variations

Oracle

Supported, with variations

PostgreSQL

Supported, with variations

SQL99 Syntax and Description

DROP INDEX table_name.index_name

PostgreSQL follows the SQL99 standard, with variations.

Microsoft SQL Server Syntax and Variations

DROP INDEX {table_name | view_name}.index_name [,...n]

Microsoft SQL Server allows indexes created on both tables and views to be dropped. If a clustered index on a table that contains nonclustered indexes is dropped, all nonclustered indexes are rebuilt and assigned new pointers.

MySQL Syntax and Variations

DROP INDEX table_name.index_name [,...n]

Older versions of MySQL include this command only for compatibility reasons; however, newer versions actually destroy the specified index. The statement is functionally equivalent to the MySQL statement ALTER TABLE . . . DROP INDEX.

MySQL allows multiple indexes to be dropped by separating each table and index name with a comma.

Oracle Syntax and Variations

DROP INDEX [owner_name.]index_name

Oracle allows indexes ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL in a Nutshell, 3rd Edition

SQL in a Nutshell, 3rd Edition

Kevin Kline

Publisher Resources

ISBN: 1565927443