SQL 2016 Hosting :: How to find size of all databases in sql server

To find size of all databases in sql server this query is very useful
Download the script here

cheap-aspnet-46-hosting-2

SELECT

d.name,
d.create_date,
d.database_id,
ROUND(SUM(mf.size) * 8 / 1024, 0) Size_MBs

FROM

sys.master_files mf

INNER JOIN sys.databases d

ON d.database_id = mf.database_id

WHERE

d.database_id > 4 — Skip system databases

GROUP BY

d.name, d.create_date,d.database_id

ORDER BY

Size_MBs desc

Output will be:

output script sql database

 

BEST SQL 2016 HOSTING RECOMMENDATION

ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers SQL 2016 hosting starts from $5. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable SQL 2016 Hosting, we should be your best choice.