To get recent size of all databases on an instance, I have found following simple query very useful.
SELECT d.name,
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
ORDER BY d.name
In my SQLS2005 I had to cut off "(MBs)" and then it worked. Thanks
ReplyDeleteROUND(...) AS [Size_MBs]
DeleteThank you very much...
ReplyDeleteGreat stuff!!
ReplyDeleteswmrxy@yahoo.com
its really good
ReplyDeleteHow about just running "exec sp_helpdb"?
ReplyDeleteFor larger databases, you are probably aware of MySQL(TM), IBM DB2(TM), Oracle(TM), Microsoft SQL Server(TM).excel dashboard software
ReplyDelete