Thursday, March 8, 2012

SQL Query to get Database Size & Individual table size



--total database size
sp_spaceused

--individual table size
select object_name(id) [Table Name],
[Table Size] = convert (varchar, dpages * 8 / 1024) + 'MB'

from sysindexes where indid in (0,1)
order by dpages desc