Created
April 28, 2024 16:22
-
-
Save jpomfret/05b88a3ee350eda463b84963faffa752 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--restore history | |
SELECT rh.restore_date,bs.backup_start_date, rh.stop_at, rh.destination_database_name, | |
case rh.restore_type | |
when 'D' then 'Full' | |
when 'I' then 'Differential' | |
when 'L' then 'Log' end as Restore_Type, bs.server_name as SourceServer, bs.database_name as SourceDB, backup_size as backupsize_bytes, (backup_size * 0.000001) as backupsize_MB | |
FROM MSDB.DBO.restorehistory rh | |
inner join msdb.dbo.backupset bs | |
on rh.backup_set_id = bs.backup_set_id | |
ORDER BY rh.restore_date DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment