MSCEWI4040
Value overwritten, check function equivalence.
Severity
Description
Code Example
Input Code:
CREATE OR ALTER FUNCTION PURCHASING.FOO2()
RETURNS MONEY
AS
BEGIN
declare @firstValue MONEY
declare @secondValue MONEY
declare @Result MONEY
select @Result = 0
select @firstValue = SubTotal from Purchasing.PurchaseOrderHeader where PurchaseOrderID = 1
select @secondValue = SubTotal from Purchasing.PurchaseOrderHeader where PurchaseOrderID = 2
if @firstValue is not null
select @Result = @firstValue
if @secondValue is not null
select @Result = @secondValue
return @Result
END
Output Code:
Recommendations:
Last updated
