I had recently shared a few queries related to SQL Server BackUp over here:
How to do a Full and Differential Database Backup in SQL Server
Verifying and Restoring a Differential Backup using T-SQL In SQL Server
Delete BackUp and Restore History for databases in SQL Server 2005/2008
The msdb database stores details of all backup and restore operations. Now if you want to retrieve back up information of all your databases on your server, then here’s the query to do so:
SELECT database_name, user_name as ExecutedBy, physical_device_name,
backup_finish_date, backup_finish_date
FROM msdb..backupset bckset
INNER JOIN msdb..backupmediafamily bckfmly
ON bckset.media_set_id = bckfmly.media_set_id
OUTPUT
Note: I have run this query on a new setup hence do not have many backup’s.
2 comments:
hey its good stuff
Thanks for the script. Had a question regarding output. I've got several lines per DB per day, and some of the physical_device_name outputs look like {59569BB3-0139-4BE0-83D8-BDBD990266EF}7. What is that about?
Thanks again!
Post a Comment