Discuz!NT|BBS|论坛

注册

 

发新话题 回复该主题

sql server定时备份数据库? [复制链接]

1#
定时备份代码如下

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


DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'E:\拓扑物业网页版数据备份\' + 'toppms'+@strPath + '.bak'
BACKUP DATABASE [toppms] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT


DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'F:\拓扑物业网页版数据备份\' + 'toppms'+@strPath + '.bak'
BACKUP DATABASE [toppms] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT


DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'D:\物业软件数据备份\' + 'toppms'+@strPath + '.bak'
BACKUP DATABASE [toppms] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT


DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'E:\物业软件数据备份\' + 'toppms'+@strPath + '.bak'
BACKUP DATABASE [toppms] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT



DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'F:\物业软件数据备份\' + 'toppms'+@strPath + '.bak'
BACKUP DATABASE [toppms] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT


DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'D:\拓扑物业管理系统\bak\' + 'toppms'+@strPath + '.bak'
BACKUP DATABASE [toppms] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT



DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'D:\拓扑物业数据备份\' + 'TOPPower_Net'+@strPath + '.bak'
BACKUP DATABASE [TOPPower_Net] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
本主题由 管理员 admin 于 2020/4/2 15:20:42 执行 主题置顶/取消 操作
分享 转发
TOP
发新话题 回复该主题