What are my tables?
Revision as of 12:44, 11 July 2012 by Connor (Created page with "Get a list of all tables <div class='ht'> <div> We should expect to find a system table that includes a list of tables. We should expect this to contain a great deal of extra ...")
Get a list of all tables
We should expect to find a system table that includes a list of tables. We should expect this to contain a great deal of extra data that is hard to understand.
CREATE TABLE bbc (name VARCHAR(10), region VARCHAR(10)); INSERT INTO bbc VALUES ('Poland', 'Europe'); INSERT INTO bbc VALUES ('Japan', 'Asia');
SELECT * FROM sqlite_master WHERE TYPE='table'
SELECT * FROM syscat.TABLES WHERE tabschema = 'SCOTT'
SELECT Name FROM MSysObjects WHERE TYPE=1 AND Flags=0
SELECT tablename FROM pg_tables WHERE tableowner = CURRENT_USER
SELECT * FROM cat
SELECT * FROM sysobjects WHERE xtype='U'
SELECT * FROM information_schema.TABLES WHERE table_type='BASE TABLE'
SELECT * FROM sysobjects WHERE TYPE='U'
sqlite_masterlists tables and indexes.
See SYSCAT.TABLES documentation.
From within Access the system tables can be viewed by ticking the appropriate box under Tools/Options/View.
See also user_tables and user_catalog.
See also sp_table and table sysobjects.