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 tablename,reserved desc

 

你可能感兴趣的:(SQL Server查询所有的表名/空间占用量/行数)