Posted By

pollusb on 04/16/09



Versions (?)

Last Backup Date for All databases

 / Published in: SQL

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.

  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  

You need to login to post a comment.