Home  »  Code Snippets  »  SQL Server  »

How to know the database restore details in SQL Server?

 Posted By : Manoranjan SahooPosted Date : 10/09/2012 07:33:57 AM Category : SQL Server Points : 3

Here i am going to show you, how to check the database restoration details in our sql server.

Use the below code to do so :

use msdb;
select
    DataBaseRestored = r.destination_database_name,
    RestoreDate = r.restore_date,
    DestinationFile = rf.destination_phys_name,
    SourceDataBase = b.database_name,
    SourceFile = f.physical_name,
    BackupDate = b.backup_start_date
from RestoreHistory r inner join BackupSet b
      on r.backup_set_id = b.backup_set_id
inner join BackupFile f
      on f.backup_set_id = b.backup_set_id
inner join RestoreFile rf
      on rf.restore_history_id=r.restore_history_id
order by RestoreDate

Responses
No responses found for this thread. Be the first to respond this thread.
Post Reply
Login to post Response.