TSQL script- To get database restore history

USE MSDB;
GO
 SELECT
DBRestored = destination_database_name,
RestoreDate = restore_date,
SourceDB = b.database_name,
SourceFile = physical_name,
BackupDate = backup_start_date
FROM RestoreHistory h
INNER JOIN BackupSet b
ON h.backup_set_id = b.backup_set_id
INNER JOIN BackupFile f
ON f.backup_set_id = b.backup_set_id
ORDER BY RestoreDate

  

No comments: