DROP INDEX#
Removes the index from the current virtual database. It is a metadata-only operation.
Syntax#
DROP INDEX index_name ON <object>
[;]
<object> ::=
{
[ database_name. [ schema_name ] . | schema_name. ]
view_name
}
Arguments#
index_name
Is the name of the index to be dropped.
database_name
Is the name of the database.
schema_name
Is the name of the schema to which the view belongs.
view_name
Is the name of the view associated with the index.
To display a report of the indexes on an object, use the sys.indexes catalog view.
Permissions#
Requires an ALTER permission on the view. User must be a member of the sysadmin fixed server role or the db_ddladmin and db_owner fixed database roles.
Metadata#
To view information on existing indexes, you can query the sys.indexes catalog view.
Examples#
The following example deletes the index IX_ProductVendor_VendorID on the ProductVendor view in the AdventureWorks2012 database.
DROP INDEX IX_ProductVendor_BusinessEntityID
ON Purchasing.ProductVendor;