sp_remote_columns system procedure

Produces a list of the columns in a remote table, and a description of their data types.

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

Syntax
sp_remote_columns(
  @server_name,
  @table_name
  [, @table_owner
  [, @table_qualifier] ]
)
Arguments
  • @server_name   Use this CHAR(128) parameter to specify a string containing the server name as specified by the CREATE SERVER statement.

  • @table_name   Use this CHAR(128) parameter to specify the name of the remote table.

  • @table_owner   Use this optional CHAR(128) parameter to specify the owner of @table_name.

  • @table_qualifier   Use this optional CHAR(128) parameter to specify the name of the database in which @table_name is located.

Result set
Column name Data type Description
database CHAR(128) The database name.
owner CHAR(128) The database owner name.
table-name CHAR(128) The table name.
column-name CHAR(128) The name of a column.
domain-id SMALLINT An INTEGER which indicates the data type of the column.
width SMALLINT The meaning of this field depends on the data type. For character types width represents the number of characters.
scale SMALLINT The meaning of this field depends on the data type. For NUMERIC data types scale is the number of digits after the decimal point.
nullable SMALLINT If null column values are allowed this field is 1. Otherwise nullable is 0.
Remarks

If you are entering a CREATE EXISTING statement and you are specifying a column list, it may be helpful to get a list of the columns that are available on a remote table. sp_remote_columns produces a list of the columns on a remote table and a description of their data types. If you specify a database, you must either specify an owner or provide the value NULL.

Standards and compatibility
  • Sybase   Supported by Open Client/Open Server.

Permissions

None

Side effects

None

See also
Example

The following example returns columns from the SYSOBJECTS table in the production database on an Adaptive Server Enterprise server named asetest. The owner is unspecified.

CALL sp_remote_columns( 'asetest', 'sysobjects', null, 'production' );