SQLServer 2008:备份文件的名称

发布于 2024-09-06 07:17:59 字数 214 浏览 2 评论 0原文

我有一个 SQL Server 2008,我会更改备份文件的名称。 我使用 SSIS 包来执行备份。

该文件的名称看起来像

[DATABASE_NAME]_backup_YYYY_MM_DD_XXXXXX_XXXXXX

这是由 SqlServer 自动生成的,我想删除“_”。

我该如何修改这个?

提前谢谢你,

安迪。

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 "_".

How I can modify this ?

Thank you in advance,

Andy.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

仙气飘飘 2024-09-13 07:17:59

我今天遇到了类似的情况并使用了以下解决方法。

使用“执行进程任务”重命名备份。我使用以下命令创建了一个批处理文件,并在数据库备份任务之后执行它。

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

上述命令会将 DBNAME.bak 文件重命名为 DBNAME_yyyymmdd.bak

将该文件保存在保存备份文件的同一文件夹中。在“执行流程任务编辑器”中,在“可执行文件”属性中指定批处理文件名,并在“工作目录”属性中指定批处理文件的位置。

希望有帮助。

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.

守不住的情 2024-09-13 07:17:59

我相信您可以使用 DestinationManualList 来实现此目的,尽管我自己从未使用过它,而且我似乎无法在任何地方找到它的文档或示例。它出现在备份数据库任务的属性列表中,但不出现在它的对话框中。

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.

终难遇 2024-09-13 07:17:59

我不相信您可以手动编辑 DestinationManualList 属性。右键单击任务并选择编辑。在打开的对话框中,单击“跨一个或多个文件备份数据库”,然后单击“添加”按钮。在“选择备份目标”对话框中,单击“文件名”并输入路径,包括文件的名称和扩展名。您输入的内容将显示在 DestinationManualList 集合中。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文