This is my technical area for troubleshooting and learning new programming skills and much more. Here, you will find answers on a wide range of technologies such as AI, Machine Learning, OpenAI, Databricks, ASP.NET, C#, Python, Microsoft Access, MySQL, Amazon Web Services, SQL Server, PL/SQL, JD Edwards, SAS, Salesforce, APIs, MVC, and many others. Please feel free to visit and join the discussion!
Tuesday, May 5, 2020
Get the size of all database in a SQL-Server
SELECT DB_NAME(database_id) AS DatabaseName,
sum((size * 8.0) / 1024.0) SizeMB
FROM sys.master_files
WHERE DB_NAME(database_id) in(SELECT name FROM sys.databases ) group by DB_NAME(database_id) order by 1
No comments:
Post a Comment