Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Display Rows/Space Used by all user tables

By jennyma,

This procedure will display the rows, reserved, data, index and unused space used in KB for all user tables in the database.  The idea is to call sp_spaceused repeatedly. 

Limitation: certain versions of sp_spaceused will truncate the table name to 20 characters.
Speed will depend on current activity level and locking in the database.  It will be nice if Microsoft will write sp_spaceused with the nolock option.  You can always create your own version of sp_spaceused with the necessary modifications :-)

Total article views: 379 | Views in the last 30 days: 3
 
Related Articles
FORUM

sp_spaceused

sp_spaceused

FORUM

spaceused of a table

spaceused query...

BLOG

sp_spaceused system-stored procedure

You can use the sp_spaceused system-stored procedure to return space usage information about a datab...

BLOG

Capturing DB Usage stats – sp_spaceused simulation using DMV’s.

SP_SPACEUSED sp_spaceused is one of the system stored procedure used frequently by many dba’s tha...

FORUM

sp_spaceused returns same even after deleteing 3.5 lac records.

sp_spaceused returns same even after deleteing 3.5 lac records.

 
Contribute