December 8, 2008 at 3:58 am
hi all
i want to know how to count the number of tables in a database. if it is possible through any command or other . tell me pls
thanks
aswin..
December 8, 2008 at 4:14 am
Select count(*) from sys.tables
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 8, 2008 at 4:18 am
select count(TABLE_NAME)
from INFORMATION_SCHEMA.Tables
Will return all tables and views.
To just return count of tables (no views), use:
select count(TABLE_NAME)
from INFORMATION_SCHEMA.Tables
where Table_Type = 'Base Table'
December 8, 2008 at 5:15 am
thanks
aswin..
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply