SQL2008-备份SQL数据库的语句

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

posted @ 2017-10-31 19:09  麦麦提敏  阅读(468)  评论(0编辑  收藏  举报