Wednesday, March 7, 2007

SQL Server: BACKUP... RETAINDAYS doesn't do what you might think

I was just scouting around for a way to make the backup set on a backup device expire and get overwritten periodically. I found the RETAINDAYS clause of the BACKUP command. I thought this might do it, but as it turns out, it merely *protects* a backup set for the number of days specified. That means that if you try to do a BACKUP..INIT of a backup device and it was unexpired backups, your backup will fail! Just another case of RTFM!

No comments:

Post a Comment

I moderate comments blog posts over 14 days old. This keeps a lot of spam away. I generally am all right about moderating. Thanks for understanding.