Solved

Find the date the database was last restored

Posted on 2008-10-03
5
499 Views
Last Modified: 2010-04-21
I have MS SQL Server 2005.  Is it possible to find out the date that the database was last restored?
0
Comment
Question by:saturation
  • 3
  • 2
5 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 22634747
select distinct physical_device_name,  * from backupfile bf
join backupset bs on bf.backup_set_id = bs.backup_set_id
join backupmediafamily bm on bs.media_set_id = bm.media_set_id
where database_name = 'yourdbname'
order by backup_finish_date desc
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22634758
sorry...misread.  Look at the create_date in this query:

select * from sys.databases
0
 

Author Comment

by:saturation
ID: 22634829
That shows the created date, but is there a date for the last time a DB was restored into that database?
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 22634909
select * from msdb..restorehistory
0
 

Author Closing Comment

by:saturation
ID: 31502785
Perfect!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question