执行备份数据库命令以时间戳命名保存
CREATE PROCEDURE [dbo].[xmfgxwldat]
AS
BEGIN
DECLARE @DATE NVARCHAR(50)
SET @DATE= 'D:\'+STR((SELECT DATEDIFF(S,'1970-01-01 00:00:00', GETDATE())) )+'.bak'
PRINT(@DATE)
BACKUP DATABASE xmfgxwldataa TO DISK =@DATE
END
执行作业分析存储过程命令
USE [xmfgxwldataa]
GO
DECLARE @return_value NVARCHAR(max)
EXEC @return_value = [dbo].[xmfgxwldat]
SELECT 'Return Value' = @return_value
GO