Last Backup for All Databases In SQL Server

Open SQL server and write following query;

  1. SELECT a.Name AS [DB_Name],  
  2.   
  3. COALESCE(CONVERT(VARCHAR(12), MAX(b.backup_finish_date), 101), '-'AS LastBackup  
  4.   
  5. FROM sys.sysdatabases a  
  6.   
  7. LEFT OUTER JOIN msdb.dbo.backupset b ON b.database_name = a.name  
  8.   
  9. GROUP BY a.Name  

The above query will show the last backup data of all databases as you can see it in following image.

Ebook Download
View all
Learn
View all