This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a simple use of sp_spaceused system stored procedure of SQL Server.
Most of the SQL Server professional already knew about this system stored procedure, but I am going to tell about the @updateusage parameter of sp_spaceused.
Sometimes, sp_spaceused is not giving updated/accurate space information of database/objects. In that case, we have to use sp_spaceused with @updateusage parameter.
The @updateusage parameter will ensure that returned value is updated and accurate.
Check the space information of a database:
1 2 |
sp_spaceused @updateusage = 'TRUE' |
Check the space information of a table:
It will also return the space information of table indexes.
1 2 3 |
sp_spaceused @objname = 'table_name' ,@updateusage = 'TRUE' |
Leave a Reply