Some times we need to know when the database had its last backup or restore
msdb Database holds the details of all the Backups and Restores happened on a server.
backupset table holds the details of Backups
restorehistory table holds the details of Restores.
Below scripted code will bring the list of backup and Restore for the given database.
Here we GO..!!
Code to list Backup.
select database_name,backup_finish_date ,user_name from msdb..backupset
order by backup_finish_date desc
Code to list Restore.
select destination_database_name,restore_date,user_name from msdb..restorehistory
order by restore_date desc