SELECT rh.destination_database_name, rh.user_name, bk.first_lsn,
rh.restore_date, bk.backup_start_date, bk.recovery_model
FROM msdb..restorehistory rh
INNER JOIN msdb..backupset bk ON rh.backup_set_id = bk.backup_set_id
WHERE rh.destination_database_name IN
(SELECT name from sys.sysdatabases)
AND bk.type = 'D'
Output:
destination_database_name user_name first_lsn restore_date backup_start_date recovery_model
Northwind Suprotim-PC\Suprotim 41000000016800052 2009-03-14 17:58:36.653 2009-03-14 17:58:18.000 SIMPLE
The msdb..backupset is a very useful table and you can also get important details like the LSN (Log Sequence Number) used for a differential backup set.
No comments:
Post a Comment