sp_remote_primary_keys system procedure

Provides primary key information about remote tables using remote data access.

Syntax

sp_remote_primary_keys(
 @server_name
 , @table_name
 [, @table_owner
 [, @table_qualifier ] ] 
)

Arguments

Result set

Column name Data type Description
database CHAR(128) The name of the remote database.
owner CHAR(128) The owner of the table.
table_name CHAR(128) The name of the table.
column_name CHAR(128) The name of the primary key column.
key_seq SMALLINT The primary key sequence number.
pk_name CHAR(128) The primary key name.

Remarks

This system procedure provides primary key information about remote tables using remote data access.

Because of differences in the underlying ODBC calls, the information returned differs slightly from the catalog/database value depending upon the remote data access class that is specified for the server.

Privileges

None

Standards and compatibility

Side effects

None

Examples

The following example returns information about the primary keys in tables owned by DBA in a SAP Sybase IQ remote server named RemoteSA.

CALL sp_remote_primary_keys( 'RemoteSA', null, 'DBA' );

To get a list of the primary keys in all the tables owned by Fred in the production database in an Adaptive Server Enterprise server named RemoteASE:

CALL sp_remote_primary_keys( 'RemoteASE', null, 'Fred', 'production' );