Sometimes you may be on need of knowing what the backup type of the backup file is. For example the backup file may be of full backup, transaction log, diffential database etc. If you want to know it before restoring a database you can use RESTORE HEADERONLY option
Assume that you have a backup file test.bak and you want to know the backup type before restoring it
RESTORE HEADERONLY FROM DISK='F:\TEST.BAK'
It will display the all the backup header informations. Now look the column backuptype. Each value belongs to a different backup type
1 = Database 2 = Transaction log 4 = File 5 = Differential database 6 = Differential file 7 = Partial 8 = Differential partial
You can find more explanations about this at SQL Server help file under the index RESTORE HEADERONLY statement
Tags: t-sql, sql_server, backup, sqlserver, tsql, BRH, restore,