获取DB备份信息

 

select bs.database_name as 'DBName',
case bs.type
when 'D' then 'Database'
when 'L' then 'Log'
when 'I' then 'Differential'
when 'F' then 'File/FileGroup'
when '' then ''
else isnull(bs.type, '<null>')
end as 'Type',
bs.backup_start_date as 'StartTime',
bs.backup_finish_date as 'FinishTime',
convert(float, bs.backup_size / (1024 * 1024)) as 'SizeMB',
bumf.physical_device_name as 'Device'
from
msdb.dbo.backupset bs
inner join
msdb.dbo.backupmediafamily bumf on bs.media_set_id = bumf.media_set_id

你可能感兴趣的:(JOIN,Date,null,database,float)