Search

Monday, October 17, 2011

How to find out the last time your database was restored

DECLARE @DatabaseName as varchar(50)


SET @DatabaseName = 'YOUR DATABASE NAME'

SELECT destination_database_name,max(restore_date) as restore_date from msdb..restorehistory

WHERE destination_database_name = @DatabaseName

GROUP BY destination_database_name

No comments:

Post a Comment