Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a SQL Server database with multiple hundreds of data tables in it, and I am looking for disk usage statistics, as it relates to each individual table.

Is there a quick way to find this information?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Marc Brown put together a stored procedure using the sp_spaceused and sp_tables system stored procedures to gather that information. Also, if you don't mind using a Microsoft private procedure, this stored procedure is a bit shorter method of accomplishing the same goal.

share|improve this answer
add comment

Which SQL Server version?
Which 'usage' statistics? Size? Reads? Writes?

For size you look into sys.allocation_units:

select object_name(object_id) as [Object]
 , sum(au.total_pages)*8 as [Size (Kb)]
 from sys.allocation_units au
 join sys.partitions p on au.container_id = p.partition_id
 group by object_id
 having sum(au.total_pages) > 0

For IO you look into sys.dm_db_index_usage_stats.

Another possible approach is to enable performance collector sets and use the SQL Server 2008 Management Data Warehouse.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.