sp_dropobjectdef

(Component Integration Services only) Deletes the external storage mapping provided for a local object.

Syntax

sp_dropobjectdef tablename

Parameters

Examples

Usage

There are additional considerations when using sp_dropobjectdef:
  • sp_dropobjectdef deletes the external storage mapping provided for a local object. It replaces sp_droptabledef.

  • Use sp_dropobjectdef after dropping a remote table with drop table.

  • Dropping a table does not remove the mapping information from the sysattributes table if it was added using sp_addobjectdef. It must be explicitly removed using sp_dropobjectdef.

  • The tablename can be in any of these forms:
    • object

    • owner.object

    • dbname..object

    • dbname.owner.object

See also create existing table, create table, drop table in Reference Manual: Commands.

Permissions

The permission checks for sp_dropobjectdef differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be the object owner or a user with drop any table privilege.

Disabled

With granular permissions disabled, you must be the object owner, the database owner, or a user with sa_role.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

Related reference
sp_addobjectdef