sp_tables_ex (Transact-SQL)
Zwraca wartość tabela informacji o tabelach z określonego serwer połączony.
sp_tables_ex [ @table_server = ] 'table_server'
[ , [ @table_name = ] 'table_name' ]
[ , [ @table_schema = ] 'table_schema' ]
[ , [ @table_catalog = ] 'table_catalog' ]
[ , [ @table_type = ] 'table_type' ]
[ , [@fUsePattern = ] 'fUsePattern' ]
Argumenty
[ @table_server= ] 'table_server'
Is the name of the linked server for which to return table information.table_server is sysname, with no default.[ , [ @table_name= ] 'table_name']
Is the name of the table for which to return data type information.table_nameis sysname, with a default of NULL.[ @table_schema= ] 'table_schema']
Is the table schema.table_schemais sysname, with a default of NULL.[ @table_catalog= ] 'table_catalog'
Is the name of the database in which the specified table_name resides.table_catalog is sysname, with a default of NULL.[ @table_type= ] 'table_type'
Is the type of the table to return.table_type is sysname, with a default of NULL, and can have one of the following values.Wartość
Description
ALIAS
Nazwa alias.
GLOBAL TEMPORARY
Nazwa systemu dostępne tabela tymczasowa szerokości.
LOCAL TEMPORARY
Nazwa tabela tymczasowa dostępne tylko dla bieżącego zadanie.
SYNONYM
Nazwa synonimu.
SYSTEM TABLE
Nazwa tabela systemowa.
WYŚWIETLANIE SYSTEMU
Nazwa widoku systemu.
TABLE
Nazwa tabela użytkownika.
VIEW
Nazwa widoku.
[ @fUsePattern= ] 'fUsePattern'
Determines whether the characters _, %, [, and ] are interpreted as wildcard characters.Valid values are 0 (pattern matching is off) and 1 (pattern matching is on).fUsePattern is bit, with a default of 1.
Wartości kodów powrotnych
None
Zestawy wyników
Nazwa kolumna |
Typ danych |
Description |
---|---|---|
TABLE_CAT |
sysname |
Nazwa kwalifikator tabela.Różne produkty DBMS obsługuje trzy części nazw tabel)Kwalifikator.owner.name).W SQL Server 2008, w tej kolumnie oznacza nazwę bazy danych. W przypadku niektórych produktów reprezentuje nazwa serwera bazy danych środowiska w tabela.To pole może mieć wartość NULL. |
TABLE_SCHEM |
sysname |
Nazwa właściciela tabela.W SQL Server, ta kolumna odpowiada nazwie użytkownika bazy danych, który utworzył w tabela. To pole zawsze zwraca wartość. |
TABLE_NAME |
sysname |
Nazwa tabela.To pole zawsze zwraca wartość. |
TABLE_TYPE |
varchar(32) |
Tabela, tabelę systemową lub widok. |
REMARKS |
varchar(254) |
SQL Server nie zwraca wartości dla tej kolumna. |
Remarks
sp_tables_ex jest wykonywane za pomocą kwerend wysyłanych do zestawu zestaw wierszy tabele IDBSchemaRowset interfejs dostawca OLE DB, odpowiadający table_server. The table_name, table_schema, table_catalog, and column parameters are passed to this interfejs to restrict the rows returned.
sp_tables_ex zwraca wynik puste, jeśli dostawca OLE DB z określonego serwer połączony nie obsługuje zestaw wierszy tabele IDBSchemaRowset interfejs.
Uprawnienia
Wymaga uprawnienie SELECT do schematu.
Przykłady
W poniższym przykładzie zwraca informacje o tabelach, które są zawarte w HumanResources schemat w AdventureWorks bazy danych na LONDON2 serwer połączony.
EXEC sp_tables_ex @table_server = 'LONDON2',
@table_catalog = 'AdventureWorks',
@table_schema = 'HumanResources',
@table_type = 'TABLE'
See Also