Solved

Find the date the database was last restored

Posted on 2008-10-03
5
500 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS SQL Conditional WHERE clause 3 38
Need to find substring in SQL 5 42
SQL query 7 18
Office 365: Assigning MailboxPlan to a mailbox 8 20
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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