Use below T-Sql command to find the database size in GBs,TB's
--Database Sizes
select
'server' = @@servername,d.NAME
, 'total size in megabytes'= convert(decimal(10,2),(sum(size * 8.00) / 1024.00 ))
, 'total size in gigabytes' = convert(decimal(10,2),(sum(size * 8.00) / 1024.00 / 1024.00))
, 'total size in terabytes' = convert(decimal(10,2),(sum(size * 8.00) / 1024.00 / 1024.00 / 1024.00)) from
sys.master_files mf
INNER JOIN sys.databases d ON d.database_id = mf.database_id
WHERE d.database_id > 4
and d.is_read_only<>1
GROUP BY d.NAME
ORDER BY d.NAME
No comments:
Post a Comment