标签:备份脚本 diff ini date() varchar nload load blog cmd
declare @name varchar(100) declare @disk varchar(100) declare @temp varchar(100) set @temp=Replace(Replace(Replace(Replace(Convert(varchar(30),GETDATE(),21),‘:‘,‘‘),‘ ‘,‘‘),‘-‘,‘‘),‘.‘,‘‘) set @name=N‘DEMO‘+@temp+‘-完整 数据库 备份‘ set @disk=N‘F:\Backup\[full]DEMO‘+@temp+‘.bak‘ BACKUP DATABASE [CMDI] TO DISK = @disk WITH NOFORMAT, NOINIT, NAME = @name, SKIP, NOREWIND, NOUNLOAD, STATS = 10 declare @name1 varchar(100) declare @disk1 varchar(100) declare @temp1 varchar(100) set @name1=N‘DEMO‘+@temp+‘-差异 数据库 备份‘ set @disk1=N‘F:\Backup\[diff]DEMO‘+@temp+‘.bak‘ BACKUP DATABASE [CMDI] TO DISK = @disk1 WITH DIFFERENTIAL , NOFORMAT, NOINIT, NAME = @name1, SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO
标签:备份脚本 diff ini date() varchar nload load blog cmd
原文地址:http://www.cnblogs.com/zhaoboxing/p/7212029.html