-- Get size of all DBs in MB
-- Last update: MsMiller 09/08/09
--SQL 2005&2008
SELECT DB_NAME(database_id) AS DatabaseName ,sum((size*8)/1024) as MB
FROM sys.master_files
WHERE db_name(database_id) not in ('master','tempdb','model','msdb')
GROUP BY database_id
--SQL 2000
SELECT DB_NAME(dbid) AS DatabaseName ,sum((size*8)/1024) as MB
FROM master..sysaltfiles
WHERE db_name(dbid) not in ('master','tempdb','model','msdb')
GROUP BY dbid