syscomments

RocketScientist's Miscellaneous Ramblings
posts - 76, comments - 354, trackbacks - 3

October 2010 Blog Posts

Tables, and the space they use

So I hacked around in sp_spaceused and got this sorted out. Works in SQL 2005, haven't tested north or south of that.  Share and enjoy. drop table #mainpartitionstats drop table #LOBPartitionStats drop table #totals     SELECT         object_name(object_id) name,         SUM (reserved_page_count) reserved_page_count,         SUM (used_page_count) used_page_count,         SUM (             CASE                 WHEN (index_id < 2) THEN (in_row_data_page_count + lob_used_page_count + row_overflow_used_page_count)                 ELSE lob_used_page_count + row_overflow_used_page_count             END             ) Pages,         SUM (             CASE                 WHEN (index_id < 2) THEN row_count                 ELSE 0    ...

posted @ Tuesday, October 05, 2010 5:21 PM | Feedback (0) | Filed Under [ KCTechBlog Syndication ]

Powered by:
Powered By Subtext Powered By ASP.NET