我有提到的 SQL Query @Result
。现在我想将值赋给 DFT@Result
中声明的变量Execute SQL task
。你能帮帮我吗?
这是查询:
DECLARE @Result SMALLINT
DECLARE @VALUE SMALLINT
BEGIN
SET @VALUE = (SELECT Value
from dbo.LDMStockIntegrityCheck
where InterfaceName = 'I0180'
and FileName = 'PIZ.ED.NBFS001.PICSHT.DATA.LDM')
SET @Result = 0;
IF (@VALUE = 1)
BEGIN
Select @Result = count(*) from dbo.LDMIntegrityErrorLog
where InterfaceName = 'I0180' and FileName = 'PIZ.ED.NBFS001.PICSHT.DATA.LDM'
and CONVERT(VARCHAR(10), DateTime, 120) = CONVERT(VARCHAR(10), getdate(), 120);
END
END