sp_remote_columns system procedure

Function

Produces a list of the columns on a remote table, and a description of those columns. For each column, the procedure returns its database, owner, table, column, domain ID, width, scale, and nullability.

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

NoteYou cannot capture output from this procedure in a file. If you use the redirection operator, you receive the message “Cursor is restricted to Fetch Next operations.”

Syntax

sp_remote_columns servername  [, tablename ] [, owner ] [, database ]

Permissions

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

Description

If you are entering a CREATE EXISTING statement and you are specifying a column list, it might 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 those data types.

Example

Gets a list of the columns in the sysobjects table in the production database in an Adaptive Server server named asetest:

sp_remote_columns asetest, sysobjects,
null, production

Standards and compatibility

Sybase Supported by Open Client/Open Server.

See also

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

CREATE SERVER statement in Reference: Statements and Options