当前位置: 代码迷 >> SQL >> sql2005自动备份授命
  详细解决方案

sql2005自动备份授命

热度:85   发布时间:2016-05-05 13:50:04.0
sql2005自动备份指令
DECLARE @strPath NVARCHAR(200)set @strPath = convert(NVARCHAR(19),getdate(),120)+'ximeng_we'set @strPath = REPLACE(@strPath, ':' , '.')set @strPath = 'E:\data\' + @strPath + '.bak'BACKUP DATABASE [ximeng_web] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT




[email protected] 是设置自动备份文件名和路径
[ximeng_web] 是我们要备份的数据库,BACKUP DATABASE

  相关解决方案