ITableDefinition::DropTable

Drops a base table in the data store.

Syntax

HRESULT DropTable (
   DBID *pTableID);

Parameters

  • pTableID
    [in] A pointer to the DBID of the base table to drop.

Return Code

  • S_OK
    The method succeeded and the table is dropped.

  • E_FAIL
    A provider-specific error occurred.

  • E_INVALIDARG
    pTableID was a null pointer.

  • DB_E_DROPRESTRICTED
    The provider could not drop the table because pTableID was referenced in a view definition.

    The provider could not drop the table because pTableID was referenced in a constraint belonging to a table other than pTableID.

  • DB_E_NOTABLE
    The specified table does not exist in the current data store.

  • DB_E_TABLEINUSE
    The specified table was in use and could not be dropped.

  • DB_SEC_E_PERMISSIONDENIED
    The consumer did not have sufficient permission to drop the table.

  • XACT_E_XTIONEXISTS
    The provider supports transactional DDL, the session is participating in a transaction, and the value of DBPROP_SUPPORTEDTXNDDL is DBPROPVAL_TC_DML.

Comments

If the session is participating in a transaction, if DBPROP_SUPPORTEDTXNDDL is DBPROPVAL_TC_DDL_IGNORE, and if the method succeeds, the operation is complete and is unaffected by subsequent calls to abort or commit the transaction.

If the session is participating in a transaction, if DBPROP_SUPPORTEDTXNDDL is DBPROPVAL_TC_DDL_COMMIT, and if the method succeeds, the transaction is committed without retention. No new transaction is created. Any new work done on the session is outside the scope of a transaction. Attempting to explicitly commit or abort when there is no outstanding transaction returns an error.

See Also

Reference

ITableDefinition::CreateTable