title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Drop SQL Server index (OLE DB driver) |
Learn about the IIndexDefinition::DropIndex function in OLE DB Driver for SQL Server, which allows consumers to remove an index from a SQL Server table. |
David-Engel |
davidengel |
06/14/2018 |
sql |
connectivity |
reference |
|
[!INCLUDE SQL Server]
[!INCLUDEDriver_OLEDB_Download]
The OLE DB Driver for SQL Server exposes the IIndexDefinition::DropIndex function. This allows consumers to remove an index from a [!INCLUDEssNoVersion] table.
The OLE DB Driver for SQL Server exposes some [!INCLUDEssNoVersion] PRIMARY KEY and UNIQUE constraints as indexes. The table owner, database owner, and some administrative role members can modify a [!INCLUDEssNoVersion] table, dropping a constraint. By default, only the table owner can drop an existing index. Therefore, DropIndex success or failure depends not only on the application user's access rights but also on the type of index indicated.
Consumers specify the table name as a Unicode character string in the pwszName member of the uName union in the pTableID parameter. The eKind member of pTableID must be DBKIND_NAME.
Consumers specify the index name as a Unicode character string in the pwszName member of the uName union in the pIndexID parameter. The eKind member of pIndexID must be DBKIND_NAME. The OLE DB Driver for SQL Server does not support the OLE DB feature of dropping all indexes on a table when pIndexID is null. If pIndexID is null, E_INVALIDARG is returned.
Tables and Indexes
ALTER TABLE (Transact-SQL)
DROP INDEX (Transact-SQL)