CREATE PROCEDURE dbo.wec_GetWeight(@weight_kg varchar(20) output, @CurrWeight numeric(8,4), @Weight_Unit varchar(5)) AS BEGIN if @Weight_Unit = 'g' Set @weight_kg = @CurrWeight / 1000 else if @Weight_Unit = 'kg' Set @weight_kg = @CurrWeight else if @Weight_Unit = 't' Set @weight_kg = @CurrWeight*1000 Set @weight_kg = Cast (@weight_kg as numeric(8,4)) END GO