This is the wrong answer, see podiluska's answer to the correct one.
The result type of the case statement is the type of the first then clause. So:
CASE WHEN 1 > 2 THEN @a / 100
Makes the result of the case type @a , a real . Change this to:
CASE WHEN 1 > 2 THEN cast(@a as decima(18,10)) / 100
To get the result as decimal(18,10) .
source share