Created
May 26, 2020 16:38
-
-
Save lafleurh/c320d0a535ae5d0021b6f952e53ce919 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CASE WHEN sys.databases.name IS NULL THEN '--TOTAL--' ELSE sys.databases.name END AS DBName, | |
CAST(SUM(size)*8.0/1024.0 AS INT) AS SizeMB | |
FROM sys.databases JOIN sys.master_files ON sys.databases.database_id = sys.master_files.database_id | |
GROUP BY sys.databases.name WITH ROLLUP | |
ORDER BY SizeMB DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment