1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40:
GO /****** Object: StoredProcedure [dbo].[sp_CalcUPSHundredWeightGround] Script Date: 07/13/2010 12:55:34 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[sp_CalcUPSHundredWeightGround] -- Add the parameters for the stored procedure here @Zip nvarchar(10), @TotalWeight int, @ServiceLevel nvarchar(10), @PlantID nvarchar(50), @Tier tinyint, @Zone nvarchar(15), @UnitPrice money, @TotalPrice money output --@Results money OUTPUT AS BEGIN select @Zone = sr1 from upshundredweightzipzone where zipstart <= @Zip and zipEnd >= @Zip and PlantID = @PlantID and Tier = @Tier IF @@RowCount > 0 Begin Select @UnitPrice = Price from upshundredweightzoneprice where Zone = @Zone and "weight" >= @TotalWeight and PlantID = @PlantID and Tier = @Tier Select @TotalPrice = (@TotalWeight / 100) * @UnitPrice Return @TotalPrice End Else Begin Select @TotalPrice = 0.00 return @TotalPrice End END