December 22, 2003 at 2:17 pm
I saw a post earlier where a job can determine whether to initiaize the database device (WITH INIT) or not by using if exist or something like that. If the backup set an earlier backup set is available for less than 24 hours (condition 1), then backup the database (without INIT) in differential mode; otherwise it is over 24 hours(condition 2), then backup the database (with INIT). I searched but could not find the post. Any ideas the syntax looks like. I liked it because it was simple and elegant. It was basically using a simple if...else kind of stuff. Thanks.
December 23, 2003 at 7:42 am
Run "restore headeronly' on the last backup from your backup device and find out "backupfinishdate", compare to current datetime and issue the backup statment with/without init according to the time differences whetehr it is greater/less than 24 hours.
December 23, 2003 at 8:32 am
Or you can also specify the RETAINDAYS or EXPIREDATE parameters in the backup syntax, to let sql overwrite the backups or not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply