sql table size check

2024. 1. 11. 14:12젬스it

반응형


select
table_name = convert(varchar(30), min(o.name))
, table_size = convert(int, ltrim(str(sum(reserved)*8.192/1024., 15,0))), unit =‘mb’
from sysindexes i
inner join sysobjects o on (o.id=i.id)
where i.indid in(0, 1, 255). and o.xtype=‘u’
group by i.id
order by table_size desc;

반응형