1、查看當前庫裡面每個表空間的占用情況
select object_name(id) tablename,8*reserved/1024 reserved,rtrim(8*dpages/1024)+''Mb'' used,8*(reserved-dpages)/1024 unused,8*dpages/1024-rows/1024*minlen/1024 free,
rows,* from sysindexes
where indid=1
order by reserved desc
2、 查看單個表 exec sp_spaceused 表名稱
查看多表可通過游標取出sysobjects表中xtype=''U''的表,取出表空間的情況