Question

I have scheduled backups running through SQL Agent, with Full Backups nightly, and differential backups hourly. Is there a way to determine which of the backup files is the Full backup, and which is the latest differential?

Intuitively, it would seem the largest backup within 24 hours is the full, and the latest smaller backup is the partial. However, this isn't robust.

Is there a way to probe the backup file to check the backup type? (Preferably in c#)

Was it helpful?

Solution

USE

RESTORE HEADERONLY FROM DISK = 'C:\AdventureWorks.BAK'

Then check the BackupType

1 = Database
2 = Transaction log
4 = File
5 = Differential database
6 = Differential file
7 = Partial
8 = Differential partial


Referrences

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top