HOW TO CHECK YOUR LAST SQL DATABASE BACKUP TIME


      It is good to check when was your last backup happened, I have wrote small query which it pull the information from msdb backupset table, it lists all the database names with last backup date and time.
It is very easy to track when was your last backup was happened. You can use the following query
.
SELECT xx.name AS [Database],
max(backup_finish_date) AS [LastBackupDate]
FROM [master].[dbo].[sysdatabases] xx
LEFT OUTER JOIN [msdb].[dbo].[backupset] xy
ON xy.database_name = xx.name
AND xy.type = 'D'
GROUP BY xx.name
ORDER BY xx.name


No comments:

Post a Comment