FindInsurance(
@Amount DECIMAL(18,2),
@Freight DECIMAL(18,2),
@FreightType VARCHAR(50),
@UseFreight BIT
) AS
SET @FreightType = (Select FreightType From tblFreight Where FreightType= @FreightType)
SET @UseFreight = (Select UseFreight From tblFreight Where UseFreight= 'TRUE')
IF FreightType = @FreightType and UseFreight= @UseFreight
BEGIN
SET NOCOUNT ON
SELECT
FreightType,InsuranceRate,InsuranceRate * (@Amount + @Freight) AS Insurance
FROM
tblFreight
Else
SELECT
FreightType,InsuranceRate,InsuranceRate * (@Amount) AS Insurance
FROM
tblFreight
END
End If
我希望能够选择一个惊吓名称,如果复选框检查它们,则计算是否为false,它会执行不同的计算