SQL Server?????????????????
???????????? ???????[ 2017/3/6 11:32:05 ] ????????????? SQL Server
????--????????????????????????????RAR??????
????--????????
????declare @day varchar(10)??@dbname varchar(20)??@filename varchar(100)??@cmd_str varchar(500)??@local_name varchar(500)
????--????????
????set @day = convert(varchar(10)??getdate()??112)
????set @dbname='database'
????set @filename=@dbname+@day
????set @local_name='y:ackupdatabase'+@filename
????--sql????
????backup database database to disk=@local_name with init
????--???????
????set @cmd_str='del y:ackupdatabase'+@dbname + convert(varchar(10)??DATEADD(DAY??-2??getdate())??112)
????EXEC master..xp_cmdshell @cmd_str
????--???RAR
????set @cmd_str='del y:ackupdatabase'+@dbname+'.rar'
????EXEC master..xp_cmdshell @cmd_str
????--?????????????????
????set @cmd_str='"C:Program FilesWinRARWinRAR.exe" a y:ackupdatabase'+@dbname+'.rar ' + @local_name
????print @cmd_str+char(10)
????EXEC master..xp_cmdshell @cmd_str
????--???????
????EXEC master..xp_cmdshell 'net use w: \200.168.15.9ackup "baijin830" /user:"WINDOWS-72AMTFXadministrator"'??no_output
????--???翽??
????set @cmd_str='copy x:ackupdatabase'+ @dbname+'.rar ' + 'w:'
????print @cmd_str+char(10)
????EXEC master..xp_cmdshell @cmd_str
????go
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11