Could anybody explain what happens in the following sql code?
declare @dividend numeric(38,22)
declare @divisor numeric(38,22)
declare @otherDivisor int
set @dividend = 1
set @divisor = 3
set @otherDivisor = 3
select cast(@dividend / @divisor as numeric(38,22)), @dividend / @otherDivisor
The result returned is
0.3333330000000000000000 0.3333333333333333333333
I would expect the same result for both calculations.