【Vegas原创】SQL Server查询某数据库所有表名行数和空间占用率


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 ROWS desc


image

喜欢请赞赏一下啦^_^
原文地址:https://www.cnblogs.com/amadeuslee/p/15131089.html