Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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