title: To add numbers and Divide it in Stored Procedure
body: <p>In the below code I have to add 4 values and divide by another value. It throws error </p>
  
  <blockquote>
    <p>must declare scalar variable </p>
  </blockquote>
  
  <p>Please help me to solve the issue.</p>
  
  <pre><code>// Passing the values
  @i_TransferQuantity float,
      @i_OnetimeCharge float,
      @i_LoadingCharge float,
      @i_UnLoadingCharge float,
      @i_FreightCharge float,
      @i_UnitPrice float
  
  DECLARE @i_LoadingCharge, @i_UnLoadingCharge,
          @i_FreightCharge, @i_UnitPrice,
          @i_TotalUnitPrice, @i_TransferQuantity Float
  
  SET @i_TotalUnitPrice = @i_LoadingCharge + @i_UnLoadingCharge +
                          @i_FreightCharge + @i_UnitPrice / @i_TransferQuantity
  </code></pre>