In this Post I will write a SQL Query for get last backup date of database.
SELECT sdb.Name AS DatabaseName,
ISNULL(CONVERT(VARCHAR(70),MAX(bus.backup_finish_date)),’-‘) AS LastBackUpTime
FROM sys.sysdatabases sdb
LEFT OUTER JOIN msdb.dbo.backupset bus ON bus.database_name = sdb.name
GROUP BY sdb.Name
SELECT sdb.Name AS DatabaseName,
ISNULL(CONVERT(VARCHAR(70),MAX(bus.backup_finish_date)),’-‘) AS LastBackUpTime
FROM sys.sysdatabases sdb
LEFT OUTER JOIN msdb.dbo.backupset bus ON bus.database_name = sdb.name
GROUP BY sdb.Name
Comments
Post a Comment