Space Usage of ALL DATABASES in the Current SERVER

Getting the Size/Space of ALL Databases in the Current Server

List the space used in all databases  within the server.

It takes all the database from the currently connected server and displays the size of the database in the result window.

EXECUTE sys.sp_MSforeachdb 'USE [?]; EXEC sp_spaceused'

 

-- Current database doesnt contain the sp_MSforeachdb proc then use master

EXECUTE sys.sp_MSforeachdb 'USE [?]; EXEC sp_spaceused'


Just drop the query and run it. J

Ebook Download
View all
Learn
View all