You are here

backups

SQL Server – Get Latest Backup File Sizes For All Databases

This returns a result for each database and includes its size in MB.

SELECT DATABASE_NAME DBNAME
,(COMPRESSED_BACKUP_SIZE / (1024*1024) ) [COMPRESSED BACKUP IN MB]
FROM MSDB..BACKUPSET BUS
WHERE BUS.BACKUP_SET_ID IN
      ( -- GET THE NEWEST BACKUP
            SELECT MAX(BACKUP_SET_ID)ASPState
            FROM MSDB..BACKUPSET
            WHERE TYPE = 'D' -- FULL BACKUP ONLY
            GROUP BY DATABASE_NAME
      )
ORDER BY DBNAME
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
7 + 10 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer