SQL see database sizes
Always wanted to do a query to see how large each database on your SQL server is, well it can be done using a simple and quick query.

The Query

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

Latest blogs

Buy me a coffeeBuy me a coffee
Created: 26/04/2018 Total Comment: 0


(Not Displayed)
Human validation
Enter 3242 number, before submitting to confirm your human
[Home] [All Blogs] [Contact] [Me]
Buy me a coffeeBuy me a coffee