- Count the number of tables :
- SELECT count(1) FROM sysobjects WHERE type = 'U'
- Count the rows for each tables :
-
select a.name,b.rows from sysobjects a inner join sysindexes b on a.id=b.id where a.type='u' and b.indid in (0,1)
-
- Count the number of columns for each tables :
-
select b.name, count(1) cols from syscolumns a join sysobjects b on a.id=b.id and b.type='u' group by b.nameselect b.name, count(1) cols from syscolumns a join sysobjects b on a.id=b.id and b.type='u' group by b.name
-