SQL Backup, excellent partial and full backup files

I have scheduled backups running through SQL Agent with full nighttime backups and hourly differential backups. Is there a way to determine which of the backup files is the full backup and which is the last differential?

Intuitively, the seemingly largest backup within 24 hours is full, while the last smaller backup is partial. However, this is not reliable.

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

+2


source to share


1 answer


USING

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

      


Links

+2


source







All Articles