- Query all data tables in a database
SELECT name 数据表 FROM sysobjects WHERE xtype='u' ORDER BY name
-
Query all data tables and the total number of data in a database
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;
-
Query the space occupied by all data tables and the total number of data in a database
SELECT OBJECT_NAME(id) 数据表, RTRIM(8 * dpages) + 'KB' 占用空间大小, rows 数据总条数 FROM sysindexes WHERE indid = 1 ORDER BY rows DESC , 数据表 , reserved DESC;
SqlServer queries all tables in a database and the total number of data and space occupied
Guess you like
Origin blog.csdn.net/qubernet/article/details/107807491
Recommended
Ranking