how to count number of tables/views/index in my database
I am using sybase 11
how to count number of tables/views/index in my database
I am using sybase 11
select count(*) from sysobjects where type = 'U'
should get you the number of user tables. You can also use type = 'V'
to count views.
select count(*) from sysindexes
will give you an index count. You may need to further filter both though, depending on which types of indexes you want.
sysobjects reference here.
sysindexes reference here.
For oracle
Count Tables:
SELECT COUNT(*) FROM user_tables;
Count Sequences
SELECT COUNT(*) FROM user_sequences;
Count Views
SELECT COUNT(*) FROM user_views;
Count Indexes
SELECT COUNT(*) FROM user_indexes;
Hi Hope this below sql works
SELECT COUNT(*) FROM USER_TABLES;
will return you number of tables in respective database.