sp_addobjectdef

(Component Integration Services only) Specifies the mapping between a local table and an external storage location.

Syntax

sp_addobjectdef tablename, objectdef [, "objecttype"]

Parameters

Examples

Usage

There are additional considerations when using sp_addobjectdef:
  • sp_addobjectdef specifies the mapping between a local table and an external storage location. It identifies the format of the object at that location.You can use sp_addobjectdef only when Component Integration Services is installed and configured.

  • sp_addobjectdef replaces the sp_addtabledef command. sp_addobjectdef allows existing scripts to run without modification. Internally, sp_addtabledef invokes sp_addobjectdef.

  • Only the system administrator can provide the name of another user as a table owner.

  • When objecttype is table, view, or rpc, the objectdef parameter takes the following form:
    "server_name.database.owner.tablename"
    • server_name – represents a server that has already been added to sysservers by sp_addserver.

    • database – may not be required. Some server classes do not support it.

    • owner – should always be provided, to avoid ambiguity. If you do not specify owner, the remote object referenced may vary, depending on whether or not the external login corresponds to the remote object owner.

    • tablename – is the name of a remote server table.

  • Use sp_addobjectdef before issuing any create table or create existing table commands. However, if a remote table exists, you need not use sp_addobjectdef before executing create proxy_table.

    create table is valid only for the objecttype values table and file. When either create table or create existing table is used, the SAP ASE server checks sysattributes to determine whether any table mapping has been specified for the object. Follow the objecttype values view and rpc with create existing table statements.

  • After the table has been created, all future references to the local table name (by select, insert, delete, and update) are mapped to the correct location.

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

  • Server Classes in the Component Integration Services User’s Guide

Permissions

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

SettingDescription
Enabled

With granular permissions enabled, you must be the table owner or a user with manage database privilege.

Disabled

With granular permissions disabled, you must be the table 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_addlogin
sp_addserver
sp_defaultloc
sp_dropobjectdef
sp_helpserver