SyntaxFix
Write A Post
Hire A Developer
Questions
I always liked going after it directly:
SELECT DB_NAME( dbid ) AS DatabaseName, CAST( ( SUM( size ) * 8 ) / ( 1024.0 * 1024.0 ) AS decimal( 10, 2 ) ) AS DbSizeGb FROM sys.sysaltfiles GROUP BY DB_NAME( dbid )