CREATE PROCEDURE dbo.wec_GetWeight(@weight_kg varchar(10) output, @CurrWeight numeric(8,3), @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 -- Das ist die neue Zeile. Der aktuelle Wert wird in einen numerischen Datentyp -- mit fixer Anzahl von Stellen konvertiert. Set @weight_kg = Cast(@weight_kg as numeric(8,3)) END Go