Skip to content

Instantly share code, notes, and snippets.

@FromMeloriWithLove
Created December 22, 2023 09:37
Show Gist options
  • Save FromMeloriWithLove/6dc6563b738ebb839d026d752eafbc99 to your computer and use it in GitHub Desktop.
Save FromMeloriWithLove/6dc6563b738ebb839d026d752eafbc99 to your computer and use it in GitHub Desktop.
SELECT
DB_NAME(database_id) AS DatabaseName,
SUM(size) * 8 AS SizeInBytes
FROM
sys.master_files
WHERE
database_id > 4
GROUP BY
database_id
ORDER BY
DatabaseName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment