Adenwei

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

1.新建作业
2.添加常规
3.添加步骤,选择T-SQL 输入下面语句(databasename修改为自己的数据库名称.D:bak改为自己的备份路径)

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 

4.添加计划,设置频率,时间等
5.要记得启用 Sql Server Agent 服务

posted on 2014-10-12 23:49  Adenwei  阅读(224)  评论(0编辑  收藏  举报