Table Name --> CostContainer
Stored Procudure:
ALTER PROCEDURE [c_Calculate_CostContainer]
@CurrencyFactor decimal (18,4),
@AreaFactor decimal (18,4),
@ProductID varchar(36)
AS
BEGIN
SET NOCOUNT ON;
--
Update #cC_CostContainer
Set
Base = PLBase * @CurrencyFactor * @AreaFactor,
Meter = PLMeter * @CurrencyFactor * @AreaFactor,
[Service] = PLService * @CurrencyFactor * @AreaFactor,
Each = PLEach * @CurrencyFactor * @AreaFactor
where PDPCGUID in (Select camosGUID from #cC_PDPC where ProductID = @ProductID)
End
Here I need to update only if "Transfer" = 0
And I have another case If "Transfer" = 1, I need to exclude the calculation.
For Example,
Case 1:
If --> "Transfer" = 0
Base = PLBase * @CurrencyFactor * @AreaFactor,
Meter = PLMeter * @CurrencyFactor * @AreaFactor,
[Service] = PLService * @CurrencyFactor * @AreaFactor,
Each = PLEach * @CurrencyFactor * @AreaFactor
If --> Transfer = 1
Base = PLBase
Meter = PLMeter
[Service] = PLService
Each = PLEach