If I backup my SQL Server 2008 R2 database with the following command

set @BackupFileName = N'C:\backup\Production-db.BAK' BACKUP DATABASE
[Production-db] TO  DISK = @BackupFileName

and run the command twice, the backup file grows to twice the current database size. With every new run, additional data is appended.

How can I create a full backup without appending, but by replacing the previous backup file?

Thanks,

Adrian

link|improve this question

80% accept rate
feedback

1 Answer

up vote 4 down vote accepted

You should specify the FORMAT clause to overwrite your media set. See the following MSDN article for more details: http://msdn.microsoft.com/en-us/library/ms191304.aspx

link|improve this answer
INIT would work in this situation as well. – Jason Cumberland Aug 5 '11 at 20:13
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.