Advertisement
Beginner SQL Server, Backup & Recovery

What are the three main types of backups in SQL Server, and what does each one capture?

Short answer

A full backup captures the entire database at a specific point in time, a differential backup captures only the changes made since the last full backup, and a transaction log backup captures all the transaction activity since the previous log backup, letting you restore your…

Save SQL Server mock interview
Advertisement
AModel answer
A full backup captures the entire database at a specific point in time, a differential backup captures only the changes made since the last full backup, and a transaction log backup captures all the transaction activity since the previous log backup, letting you restore your database to a very precise point in time.
BACKUP DATABASE MyDatabase TO DISK = 'C:\Backups\MyDatabase_Full.bak';
BACKUP DATABASE MyDatabase TO DISK = 'C:\Backups\MyDatabase_Diff.bak' WITH DIFFERENTIAL;
BACKUP LOG MyDatabase TO DISK = 'C:\Backups\MyDatabase_Log.trn';
Real-world example
A retail company takes a full backup every Sunday night, differential backups every weeknight, and transaction log backups every fifteen minutes, giving them the ability to restore their database to almost any specific moment if something goes wrong.
Likely follow-ups
  • Why would a company use differential backups instead of just taking full backups more often?
  • What recovery model does a database need to support transaction log backups?
Related topics