Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 separate blob size from other data types?

Author  Topic 

influent
Constraint Violating Yak Guru

367 Posts

Posted - 2011-10-18 : 16:46:59
I have a table with an image (blob) column in it. How can I query the system tables to see what proportion of the size of the table is taken up by the blobs versus the other columns?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-10-18 : 17:44:20
[code]SELECT OBJECT_NAME(OBJECT_ID) tbl, alloc_unit_type_desc, SUM(page_count) pages
FROM sys.dm_db_index_physical_stats(DB_ID(),NULL,NULL,NULL,NULL)
GROUP BY OBJECT_ID, alloc_unit_type_desc
ORDER BY 1, 2[/code]IN_ROW_DATA represents normal data, ROW_OVERFLOW_DATA and LOB_DATA hold the blob data. You can find more detail here: http://msdn.microsoft.com/en-us/library/ms189051.aspx

It may not be 100% accurate but it should be close.
Go to Top of Page

influent
Constraint Violating Yak Guru

367 Posts

Posted - 2011-10-19 : 11:51:04
Thank you!
Go to Top of Page
   

- Advertisement -