cast(400.000000000 * 100000000 as decimal(38,8))
--> multiplication first, maximum number of digits for the result of the calculationbased on MAXDECIMAL: 18 (fails ), then CAST
cast(400.000000000 as decimal(38,8)) * 100000000
--> CAST first to 38 digits, then multiplication (success)
Same for any cast to a decimal with sufficient precision like decimal(18,2)
Dieter
cast(400.000000000 * 100000000 as decimal(38,8))
--> multiplication first, maximum number of digits for the result of the calculationbased on MAXDECIMAL: 18 (fails ), then CAST
cast(400.000000000 as decimal(38,8)) * 100000000
--> CAST first to 38 digits, then multiplication (success)
Same for any cast to a decimal with sufficient precision like decimal(18,2)
Dieter