查询所有表名。
-- 查询所有表名 select name from sys.tables; select name from sysobjects where xtype = ‘u‘;
查询数据库中所有的表名及行数。
-- 查询数据库中所有的表名及行数 select a.name, b.rows 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;
查询所有表名及空间占用量/行数。
-- 查询所有的表名及空间占用量/行数 select object_name(id) tablename, 8 * reserved / 1024 reserved, rtrim(8*dpages)+‘kb‘ used, 8 * (reserved - dpages) / 1024 unused, 8 * dpages / 1024 - rows / 1024 * minlen / 1024 free, rows from sysindexes where indid = 1 order by tablename, reserved desc;
"人的感情很微妙,没有直白的表达,并不代表没有感情。"