How to list limited database file size in a SQL server?
1 2 3 4 5 6 7 8 9 |
SELECT DB_NAME(database_id) AS DatabaseName, [Name] AS Logical_Name, Physical_Name, (size*8)/1024 SizeMB, (size*8) as SizeKB --, SUM(size*8) OVER (partition by database_id) as [Total Size in KB] ,* FROM sys.master_files where not (max_size = -1 or max_size = 2684354561 ) -- (268435456 * 8000 = 2147483648000 = 2TB) -- and DB_NAME(database_id) not in ('master','tempdb','model') order by DatabaseName |