Skip to content

Instantly share code, notes, and snippets.

@georgepaoli
Created April 10, 2020 21:05
Show Gist options
  • Save georgepaoli/aba9a7bd2b3c83634814332180494cb7 to your computer and use it in GitHub Desktop.
Save georgepaoli/aba9a7bd2b3c83634814332180494cb7 to your computer and use it in GitHub Desktop.
Tamanho dos bancos no SQL Server
-- Fonte: https://www.c-sharpcorner.com/blogs/check-database-size-in-sql-server1
SELECT sys.databases.name,
CONVERT(VARCHAR,SUM(size)*8/1024)+' MB' AS [Total disk space]
FROM sys.databases
JOIN sys.master_files
ON sys.databases.database_id=sys.master_files.database_id
GROUP BY sys.databases.name
ORDER BY sys.databases.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment