Returns a list of objects stored in the database.
sp_tables [table_name] [, table_owner] [, table_qualifier] [, table_type]
table_name is the name of the table. Use the wildcard character to request information about more than one table.
table_owner is the owner of the table. Use the wildcard character to request information about tables owned by more than one user.
table_qualifier is ignored. Leave empty or set to NULL.
table_type is a list of values, separated by commas, requesting information about all objects of a specific type(s) as follows:
“‘TABLE’, ‘SYSTEM TABLE', ‘VIEW’, ‘ALIAS’, ‘SYNONYM’”
You must enclose each table type with single quotation
marks, and enclose the entire parameter with double quotation marks.
Enter table types in uppercase.
This function corresponds to the ODBC function SQLTables.
sp_tables returns a list of database objects. Results are ordered by the following columns:
TABLE_TYPE
TABLE_OWNER
TABLE_NAME
The lengths for varchar columns shown in the result set tables are maximums; the actual lengths depend on the target database.
The following table shows the result set for sp_tables.
Column |
Datatype |
Description |
---|---|---|
TABLE_QUALIFIER |
varchar(128) |
Always NULL |
TABLE_OWNER |
varchar(128) |
Table owner |
TABLE_NAME |
varchar(128) |
Name of the object about which information is returned |
TABLE_TYPE |
varchar(128) NOT NULL |
One of the following:
|
REMARKS |
varchar(254) |
A description of the table or NULL |
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |