CREATE PROCEDURE [dbo].[p_BackDB]
AS
BEGIN
DECLARE @weixin NVARCHAR(100)
SET @weixin = ‘E:\\DataBack\\WeiXin‘ + CONVERT(CHAR(8), GETDATE(), 112)
+ ‘.bak‘
BACKUP DATABASE WeiXin TO DISK = @weixin WITH NOINIT , NOUNLOAD , NAME = N‘WeiXin备份‘, NOSKIP, STATS = 10, NOFORMAT
DECLARE @weixinpublic NVARCHAR(100)
SET @weixinpublic = ‘E:\\DataBack\\WeiXinPublic‘
+ CONVERT(CHAR(8), GETDATE(), 112) + ‘.bak‘
BACKUP DATABASE WeiXinPublic TO DISK = @weixinpublic WITH NOINIT , NOUNLOAD , NAME = N‘WeiXinPublic备份‘,NOSKIP, STATS = 10, NOFORMAT
END