Last Backup Date for All databases


/ Published in: SQL
Save to your folder(s)

In a migration scenario, you may need to take a backup and a differential later to split the transfer over time. But to make it work, there shouldn't be any other full backup in between. This will help you check the last full backup date. Of course, you could use it for a lot of other reason.


Copy this code and paste it in your HTML
  1. -- D = Database.
  2. -- I = Database Differential.
  3. -- L = Log.
  4. -- F = File or Filegroup.
  5. SELECT serverproperty('ServerName') server_name, database_name, TYPE, MAX(backup_finish_date) backup_date
  6. FROM msdb..backupset
  7. GROUP BY serverproperty('ServerName'),database_name, TYPE
  8. ORDER BY 2,3

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.