2009-08-18

msdb.dbo.backupset

This morning I wanted to have a quick look at the backup history of a given database. This I got by this statement

SELECT [backup_start_date] AS 'Start'
,([backup_finish_date]-[backup_start_date]) AS 'Duration'
,(([backup_size]/1024)/1024)/1024 AS 'Size [GB]'
FROM [msdb].[dbo].[backupset]
WHERE [database_name]='my_database' AND [type]='D'
ORDER BY [Start] DESC;


The multiple division by 1024 is to get a clear number.

No comments: