开发者

SQLServer 2008 : Name of backup file

I have a SQL server 2008 and I would change the name of the backup file. I use an SSIS package to perform my backups.

The file's name looks like

[DATABASE_NAME]_backup_YYYY_MM_DD_XXXXXX_XXXXXX

This is automatically generated by SqlServer, and I want to remove the "_".

Ho开发者_如何转开发w I can modify this ?

Thank you in advance,

Andy.


I have faced similar situation today and used following workaround.

Use "Execute Process Task" to rename the backup. I created a batch file with following command and executed it after the Database backup task.

ren BDNAME.bak DBNAME_%date:~-4,4%%date:~-7,2%%date:~4,2%.bak

Above command will rename DBNAME.bak file to DBNAME_yyyymmdd.bak

Keep the file in the same folder where you keep the backup file. In the Execute Process Task Editor, specify batch file name in the Executable property and the location of batch file in the WorkingDirectory property.

Hope it helps.


I believe that you can use the DestinationManualList for this, although I've never used it myself and I can't seem to find documentation or examples of it anywhere. It appears in the Properties list for the Backup Database Task, but not in the dialog for it.


I don't believe you can manual edit the DestinationManualList property. Right click on the task and select Edit. In the dialog that opens click on "Back up databases across one or more files" then click on the Add button. In the Select Backup Destination dialog click on File name and enter the path including the name and extension of the file. What you've entered will then show up in the DestinationManualList collection.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜