SqlServer2005自动备份

1、在服务中启动SQL Server Agent

2、在SqlServer代理中,新建作业,使用Sql语句:

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

3、选择频率等

posted on 2010-04-26 20:43  龙少爷  阅读(235)  评论(0编辑  收藏  举报

导航