SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 Hey pal, did you restore my database?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

theboyholty
Posting Yak Master

United Kingdom
221 Posts

Posted - 06/29/2011 :  09:58:09  Show Profile  Visit theboyholty's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000