Technical Article

Recent database restores

,

Before I do database refreshes on different environments I often need to know the history of previous restores. That scripts helps me in this case. I usually limit the history by certain date like this "restore_date > '20180125 08:00'" Please change it with the date and time you are interested in also you can use filter based on the database name.

That script has been tested on SQL Server versions: 2005/2008/2008R2/2012/2014/2016.

select restore_date, destination_database_name, user_name, restore_type, 
stop_at, stop_at_mark_name, stop_before
from msdb.dbo.restorehistory
where restore_date > '20180125 08:00'
--you may use a filter on the database name as well
--AND destination_database_name like 'MyDatabase%'
order by restore_date desc;

Rate

5 (1)

You rated this post out of 5. Change rating

Share

Share

Rate

5 (1)

You rated this post out of 5. Change rating