1 SELECT COUNT(*)*8/1024 AS 'Cached Size(MB)', 2 CASE database_id WHEN 32767 THEN 'ResourceDb' 3 ELSE DB_NAME(database_id) 4 END AS 'Database' 5 FROM sys.dm_os_buffer_descriptors 6 GROUP BY DB_NAME(database_id), database_id 7 ORDER BY 'Cached Size(MB)' DESC