SQL Server – Space used for all databases

This is a useful script I use to list the space used for all databases on a given sql server

EXEC sp_msforeachdb @command1="use ? exec sp_spaceused @updateusage = N'TRUE';"

The purpose of passing the argument : @updateusage , is it updates the usage information

Author: Jack Vamvas 

Leave a Reply

Discover more from ciquery

Subscribe now to keep reading and get access to the full archive.

Continue reading