Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Script Library
 Hey pal, did you restore my database?

Author  Topic 

theboyholty
Posting Yak Master

226 Posts

Posted - 2011-06-29 : 09:58:09
Its not a Holty original, a colleague of mine came up with it recently but its a hero when you need it.

USE MSDB;

SELECT
destination_database_name as DBRestored
,restore_date as RestoreDate
,b.database_name as SourceDB
,physical_name as SourceFile
,backup_start_date as BackupDate
,h.user_name as RestoredBy

FROM RestoreHistory h with (nolock)
INNER JOIN BackupSet b with (nolock) on h.backup_set_id = b.backup_set_id
INNER JOIN BackupFile f with (nolock)on f.backup_set_id = b.backup_set_id

ORDER BY DBRestored ASC,RestoreDate DESC

GO


---------------------------------------------------------------------------------
http://www.mannyroadend.co.uk The official unofficial website of Bury Football Club
http://www.hollowtreewebdesign.co.uk - a web design company in its infancy
   

- Advertisement -