sql统计表个数以及表中字段个数

统计数据库中表的个数

select count(*) from sysobjects where type='U'


统计表中字段个数

select count(*) from syscolumns where id = object_id('表名')

你可能感兴趣的:(sql,server)