sp_tables_ex (Transact-SQL)
Returns table information about the tables from the specified linked server.
Column name | Data type | Description |
|---|---|---|
TABLE_CAT | sysname | Table qualifier name. Various DBMS products support three-part naming for tables (qualifier.owner.name). In SQL Server 2008, this column represents the database name. In some other products, it represents the server name of the database environment of the table. This field can be NULL. |
TABLE_SCHEM | sysname | Table owner name. In SQL Server, this column represents the name of the database user who created the table. This field always returns a value. |
TABLE_NAME | sysname | Table name. This field always returns a value. |
TABLE_TYPE | varchar(32) | Table, system table, or view. |
REMARKS | varchar(254) | SQL Server does not return a value for this column. |
sp_tables_ex is executed by querying the TABLES rowset of the IDBSchemaRowset interface of the OLE DB provider corresponding to table_server. The table_name, table_schema, table_catalog, and column parameters are passed to this interface to restrict the rows returned.
sp_tables_ex returns an empty result set if the OLE DB provider of the specified linked server does not support the TABLES rowset of the IDBSchemaRowset interface.
The following example returns information about the tables that are contained in the HumanResources schema in the AdventureWorks2008R2 database on the LONDON2 linked server.
EXEC sp_tables_ex @table_server = 'LONDON2', @table_catalog = 'AdventureWorks2008R2', @table_schema = 'HumanResources', @table_type = 'TABLE';
