TurboSQL Guide

System Tables

Previous  Top  Next


TurboDB uses system tables to store management information and to provide the information schema to the user. The following tables correspond to their counterparts in SQL 92

It depends on the management level of the database whether these tables are permanent or temporary. In both cases you can query on them.

sys_UserTables

Lists the user tables of the database.

sys_UserColumns

Lists the visible columns of the user tables.

sys_UserTableConstraints

Lists the names of all keys, checks and foreign keys of all user tables.

sys_UserKeyColumns

Lists all columns from user tables that make part of a (primary or candidate) key.

sys_UserCheckConstraints

Lists the check constraints including the check condition.

sys_UserReferentialConstraints

Indicates the referenced unique constraint and the referential action for each foreign key in the database.

sys_UserIndexes

Lists the indexes of all user tables.

sys_UserIndexColumns

Lists all indexed columns of all user tables.

sys_UserRoutines

Lists all stored procedures of the database.

Examples:

select ColumnName, DataType from sys_UserColumns where TableName = 'TableA'

Displays the columns and their data types for table TableA.

select I.TableName, I.IndexName, C.ColumnName
from sys_UserIndexes I join sys_UserIndexColumns C on I.TableName = C.TableName and I.IndexName = C.IndexName
where I.IsUnique = True

Displays the columns of all unique indexes.