RT
SELECT a.name, b.rows ,LTRIM (STR (b.used * 8/(case when b.used<1000 then 1 else 1024 end) , 15, 0) + (case when b.used<1000 then ' KB' else ' MB' end)) as [使用空间] ,LTRIM (STR (b.reserved * 8/(case when b.reserved<1000 then 1 else 1024 end), 15, 0) + (case when b.reserved<1000 then ' KB' else ' MB' end)) as [分配空间] 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 b.rows DESC
标签:used,各表,Sql,Server,查询数据库,2008 From: https://www.cnblogs.com/easybi/p/17750955.html