Tuesday, January 19, 2010

sp_spaceused sys stored procedure

sp_spaceused is system stored procedure used to measure the row number of table ,reserved disk space and used disk space.
Let's see an example for a table:



Let's see an example for a whole database:



Notice When you pass 'true' parameter, SQL Server will automatically runs DBCC UPDATEUSAGE to correct any inaccuracies in catalog views. So if you need absolute size you must pass it and especially after inserting large amounts of data like this:

No comments: