SQL2008:
1.备份库
BACKUP DATABASE CDJQ_CEM2008 TO DISK = 'd:\zhu\123.bak'
2.开启RAR加压功能
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
3. 加压
declare @file varchar(100)
set @file='D:\WinRAR\WinRAR.exe a -ep -df D:\zhu\123.bak'
exec master..xp_cmdshell @file
SQL2008-备份SQL数据库的语句
最新推荐文章于 2021-07-27 10:50:12 发布