sp_remote_exported_keys system procedure

Function

Provides information about tables with foreign keys on a specified primary key table.

The server must be defined with the CREATE SERVER statement to use this system procedure.

Syntax

sp_remote_exported_keys @server_name , @sp_name 
[,  @sp_owner ] [, @sp_qualifier ]

Permissions

DBA authority required. Users without DBA authority must be granted EXECUTE permission to run the stored procedure.

Description

The sp_remote_exported_keys result set includes the database, owner, table, column, and name for both the primary and the foreign key, as well as the foreign-key sequence for the foreign-key column. The result set might vary because of the underlying ODBC and JDBC calls, but information about the table and column for a foreign key is always returned.

To use sp_remote_exported_keys, your database must be created or upgraded using version 12.4.3 or higher of Sybase IQ.

Parameters

Table 7-77 lists the sp_remote_exported_keys parameters.

Table 7-77: sp_remote_exported_keys parameters

Name

Data type

Description

@server_name

varchar

Server on which the primary-key table is located. Required.

@sp_name

varchar(30)

Table containing the primary key. Required.

@sp_owner

varchar

Owner of primary-key table. Optional.

@sp_qualifier

varchar

Database containing the primary-key table. Optional.

Example

To get information about the remote tables with foreign keys on the sysobjects table, in the production database, in a server named asetest:

call sp_remote_exported_keys 
(@server_name='asetest', @sp_name='sysobjects', 
@sp_qualifier='production')

See also

Chapter 4, “Accessing Remote Data” and Chapter 5, “Server Classes for Remote Data Access” in the System Administration Guide: Volume 2

CREATE SERVER statement in Reference: Statements and Options