腳本自動備份數(shù)據(jù)庫
發(fā)布時間:2025/1/9 16:33:42 作者:Admin 閱讀:11
廣告:
DECLARE @strPath NVARCHAR(200) set @strPath = convert(NVARCHAR(19),getdate(),120) set @strPath = REPLACE(@strPath, ':' , '.') set @strPath = 'E:\HIS BACKUP\' + 'HealthOne_backup_'+@strPath + '.bak' BACKUP DATABASE [HealthOne] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT DECLARE @strPath2 NVARCHAR(200) DECLARE @strPathdel NVARCHAR(200) set @strPath2 = convert(NVARCHAR(19),getdate()-8,120) set @strPathdel = 'E:\HIS BACKUP\' + 'HealthOne_backup_'+@strPath2 + '.bak' del @strPathdel set @strPath2 = convert(NVARCHAR(19),getdate()-9,120) set @strPathdel = 'E:\HIS BACKUP\' + 'HealthOne_backup_'+@strPath2 + '.bak' del @strPathdel
廣告:
相關(guān)文章