Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using FORMAT and INIT with backup

Status
Not open for further replies.

equus2

Programmer
Mar 5, 2008
36
US
Hi,

Re SQL Server 2005

I have two scripts. One does a full backup with NO RECOVERY, and the other does a diff backup with RECOVERY.

Originally, the only option I used with the backups was WITH FORMAT.

However, when attempting to apply the diff backup after restoring the full backup, I kept getting the error:

"This differential cannot be restored because the database has not been restored to the correct earlier state"

So I added the INIT option as well to my full and diff backups and now things seem to be working fine. Was this the correct solution? I'm a bit confused as to the FORMAT and INIT options - should they be used together?

Thanks
 
The FORMAT command is if you are backing up to a tape drive. If you are going to disk it doesn't matter. The init command with overwrite your backup file everytime. So if you are trying to keep mutliple backup sets in a file or device the init will overwrite it.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
So in other words, don't use INIT if you are trying to keep multiple backup sets, correct?

Thanks
 
Correct. You just have to make sure when you restore from your backup file that you select the backup set that you need.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top