SELECT
database_name
, backup_size/1024/1024 [backup_size(MB)]
, compressed_backup_size/1024/1024 [compressed_backup_size(MB)]
, CONVERT(varchar, CONVERT(int, backup_size/compressed_backup_size) * 100) + '%' AS [Compression_Ratio(%)]
, DATEDIFF(ss, backup_start_date, backup_finish_date) [ProcessTime(sec)]
, database_creation_date
FROM msdb..backupset
ORDER BY
database_creation_date DESC
, backup_set_id DESC;
SELECT
convert(date, b.backup_finish_date) backup_finish_date,
b.database_name 'Database Name',
CONVERT (BIGINT, b.backup_size / 1048576 ) 'UnCompressed Backup Size (MB)',
CONVERT (BIGINT, b.compressed_backup_size / 1048576 ) 'Compressed Backup Size (MB)',
CONVERT (NUMERIC (20,2), (CONVERT (FLOAT, b.backup_size) /
CONVERT (FLOAT, b.compressed_backup_size))) 'Compression Ratio',
DATEDIFF (SECOND, b.backup_start_date, b.backup_finish_date) 'Backup Elapsed Time (sec)'
FROM
msdb.dbo.backupset b
WHERE
DATEDIFF (SECOND, b.backup_start_date, b.backup_finish_date) > 0
AND b.backup_size > 0
ORDER BY
b.backup_finish_date DESC