Home > Database > Mysql Tutorial > body text

SQLServer2005 按照日期自动备份的方法

WBOY
Release: 2016-06-07 18:00:59
Original
1004 people have browsed it

SQLServer2005如何备份,按照日期自动备份

SqlServer自动作业备份

1、打开SQL Server Management Studio

2、启动SQL Server代理

3、点击作业->新建作业

4、"常规"中输入作业的名称

5、新建步骤,类型选T-SQL,在下面的命令中输入下面语句

代码如下:
DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'D:\bak\' + 'databasename'+@strPath + '.bak'
BACKUP DATABASE [databasename] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT

(D:\bak\改为自己的备份路径,databasename修改为想备份的数据库的名称)

6、添加计划,设置频率,时间等。

确定,完成。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template