How to get unallocated space | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

How to get unallocated space

Hi all
exec sp_spaceused
If you run the above query u will get
database_name database_size unallocated space
————————————– —————— ——————
master 12.19 MB 0.77 MB
reserved data index_size unused
—————— —————— —————— ——————
10928 KB 9256 KB 1320 KB 352 KB
U will get the above result. My request is how to get ‘unallocated space’ value. because its return two different type of rowsets. can you help me. or give me alternate script. Thanks
S. Ramesh
Look at the definition of sp_spaceused, take a copy and modify as you please. Roji. P. Thomas

Have fun with this article. Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
This posting is provided AS IS with no rights for the sake of knowledge sharing.