dbo.fSQLTables
The function returns as a result set the list of table, catalog, or schema names, and table types, stored in a database.
Syntax
dbo.fSQLTables (<'
database_qualifier
' | null>, <'
table_name
' | null>, <['
type
' | null>)
Arguments
Table 124
dbo.fSQLTables Arguments
Parameter
Type
Default Value
Description
database_qualifier
VARCHAR
Current database
Name of the database from which the details are to be obtained
table_name
VARCHAR
(no default value)
Name of the table whose information needs to be obtained.
type
VARCHAR
(no default value)
Must be one of the following:
•
TABLE returns only the user tables
•
SYSTEM TABLE returns all the system tables
•
VIEW returns only views
•
NULL returns all tables
Returned Result Set
Table 125
dbo.fSQLTables Returned Result Set
Column Name
Data Type
Description
TABLE_QUALIFIER
VARCHAR
Name of the database; NULL if not applicable to the database.
TABLE_OWNER
VARCHAR
Name of the table owner; NULL if not applicable to the database.
TABLE_NAME
VARCHAR
Name of the table
TABLE_TYPE
VARCHAR
One of the following:
•
TABLE
•
VIEW
•
SYSTEM TABLE
REMARKS
VARCHAR
A description of the table.
Example
This example returns a list of the user tables and system tables in the default DEMODATA sample database.
SELECT * FROM dbo.fSQLTables ('Demodata', null, null)
Result Set
(abbreviated for space considerations):
TABLE_NAME TABLE_TYPE
============= ==============
X$File SYSTEM TABLE
X$Field SYSTEM TABLE
X$Index SYSTEM TABLE
X$View SYSTEM TABLE
X$Proc SYSTEM TABLE
X$Relate SYSTEM TABLE
X$Trigger SYSTEM TABLE
X$Attrib SYSTEM TABLE
X$Occurs SYSTEM TABLE
X$Variant SYSTEM TABLE
Billing TABLE
Class TABLE
Course TABLE
Dept TABLE
Enrolls TABLE
Faculty TABLE
Person TABLE
Room TABLE
Student TABLE
Tuition TABLE
X$User SYSTEM TABLE
X$Rights SYSTEM TABLE
22 rows were affected.