@HourDifference
我有一个 T-SQL 存储过程(它返回一个称为输出参数的单个标量值);你可以看到下面的执行:
DECLARE @HourDifference_output TINYINT;
-- I declare a variable to capture the output parameter--
EXEC dbo.sproc_XYZ_Notification
@HourDifference = @HourDifference_output OUTPUT;
SELECT @HourDifference_output AS HourDifferenceCaptured
我有以下要求:
如果
HourDifferenceCaptured > 12
,我需要发送电子邮件如果
HourDifferenceCaptured <= 12
,则不需要发送电子邮件;什么都不需要做。
我需要有两个时间表,一个在早上 7 点,另一个在晚上 7 点在 SQL Server 代理中。
有人可以提供代码并指导我完成此过程吗?