sp_remote_tables system procedure

Function

Returns a list of the tables on a server.

Syntax

sp_remote_tables servername [, tablename ] [, owner ] [, table_qualifier ] [, with_table_type ]

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

Permissions

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

Description

It might be helpful when configuring your database server to get a list of the remote tables available on a particular server. sp_remote_tables returns a list of the tables on a server.

The procedure accepts five parameters:

server_name Selects the server the remote table is located on.

table_name Selects the remote table.

table_owner Selects the owner of the remote table.

table_qualifier Selects the database.

with_table_type Selects the type of remote table. This parameter is a bit type and accepts two values, 0 (the default) and 1. You must enter the value 1 if you want the result set to include a column that lists table types.

The with_table_type parameter is available only for databases created in SQL Anywhere 7.0.2 and higher. If you use this parameter with an older database, the following error message is returned:

Wrong number of parameters to function 'sp_remote_tables'

If a table, owner, or database name is given, the list of tables is limited to only those that match the parameters.

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.”

Examples

Standards and compatibility

Sybase Supported by Open Client/Open Server.

See also

CREATE SERVER statement in Reference: Statements and Options

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