-- What are the sizes of my db's? GO WITH fs AS ( SELECT m.database_id , m.[type] , m.size * 8.0 / 1024 size FROM sys.master_files m ) SELECT name , (SELECT SUM (size) FROM fs WHERE [type] = 0 AND fs.database_id = db.database_id) DataFileSizeMB , (SELECT SUM (size) FROM fs WHERE [type] = 1 AND fs.database_id = db.database_id) LogFileSizeMB FROM sys.databases db
No comments:
Post a Comment