This is because if you do not declare accuracy and scale, the Decimal value indicates (18, 0) 18 digits to the left of the decimal point and 0 to the right.
If you change C like this:
declare @A decimal; declare @B decimal; declare @C decimal (18, 9); set @A = 4; set @B = 9; set @C = @A/@B select @A/@B as 'Expected' select @C as 'Wut'
You should get the right answer.
Expected --------------------------------------- 0.4444444444444444444 (1 row(s) affected) Wut --------------------------------------- 0.444444444 (1 row(s) affected)
source share