Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backup SQL Server database using WITH FORMAT

I'm having a bit of trouble understanding the purpose of the WITH FORMAT option of the SQL Server BACKUP DATABASE command.

Using the MSDN example:

USE AdventureWorks2012;
GO

BACKUP DATABASE AdventureWorks2012
    TO DISK = 'Z:\SQLServerBackups\AdventureWorks2012.Bak'
       WITH FORMAT,
            MEDIANAME = 'Z_SQLServerBackups',
            NAME = 'Full Backup of AdventureWorks2012';
GO

I understand this deletes any existing backups and creates a new one.

If I was to omit the WITH FORMAT line, and I already had a backup at Z:\SQLServerBackups\AdventureWorks2012.Bak, what does this mean to my backup?

Is it incremental or does it overwrite with a full one?

like image 641
Paperwaste Avatar asked May 12 '14 01:05

Paperwaste


1 Answers

It's a full backup, essentially appended to the file if it exists already, you'll see a File number 2 reference when you run it, and you'll see the backup file double in size. Each backup is independent of each other and either can be restored.

like image 175
SqlACID Avatar answered Sep 30 '22 00:09

SqlACID