0

When SQL Server 2005/2008 database backup jobs are run from Maintenance Plans, can they be configured to include some sequence number (or other indicator) in the filename, so that previous files with the sane name aren't overwritten? (Note I'd like to have just a single database backup in a given backup file.) For example, if my backup job runs and creates:

MyDatabase.bak

and then runs again while MyDatabase.bak stil exists, I'd like the new file to be called MyDatabase_1.bak, and so on. If I later delete MyDatabase.bak and the backup job runs, the new backup file should again be called MyDatabase.bak.

Howiecamp
  • 495
  • 2
  • 9
  • 17

2 Answers2

1

By default a database backup created from a maintenence plan will create a file based on the database name and timestamp, so a backup of a database named 10x would create a file named 10x_backup_201001062019.bak. I know this doesn't exactly answer your question but it should give you some insight into how backups are named when they're created from a maintenance plan.

joeqwerty
  • 109,901
  • 6
  • 81
  • 172
  • @joeqwerty: << I know this doesn't exactly answer your question... >> Actually, this *exactly* answers my question. I'm not sure where I was looking when I asked this question but I created a fresh new maintenance plan and I see the timestamp exactly as you said. Thanks! – Howiecamp Jan 10 '10 at 00:10
  • Glad to help... – joeqwerty Jan 10 '10 at 00:18
0

Try using Ola's dedicated maintenance jobs which date and time stamp the backups.

http://ola.hallengren.com/

These jobs have many advantages over native maintenance plans - recommended.

SuperCoolMoss
  • 1,262
  • 11
  • 20