转自SQLServer2005数据库自动备份

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修改为想备份的数据库的名称)

BackupDatabase 解释

6,新建Schedules

 

 

 

相关文章:

  • 2021-09-30
  • 2021-12-14
  • 2021-05-28
  • 2021-12-03
  • 2021-08-14
  • 2022-02-04
  • 2021-12-14
  • 2021-09-03
猜你喜欢
  • 2022-12-23
  • 2022-01-30
  • 2021-12-10
  • 2022-01-26
  • 2022-12-23
相关资源
相似解决方案