获取数据库所有表行数占用,闲话少说上码。 SELECT a.name 表名 , b.rows 记录数 ,rtrim(8*b.dpages)+'Kb' 占用, FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id WHERE (a.type = 'u') AND (b.indid IN (0, 1)) ORDER BY a.name,b.rows DESC
标签: 表
SQL查询一个表中有哪些字段
–表的字段名称 select name from syscolumns where id=object_id( '表 ') –表的字段数 select count(name) from syscolumns where id=object_id( '表 ') 建议改成:object_id(N '