Something like this?
SELECT DB_NAME(database_id) AS DatabaseName,
SUM(CASE WHEN type=0 THEN size ELSE 0 END) AS MdfSize,
SUM(CASE WHEN type=1 THEN size ELSE 0 END) AS LdfSize
FROM sys.master_files
GROUP BY database_id
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537