declare cursor_deci cursor for select SOuD_CuBal,uom_noofdecimal,sm_code from #itm declare @sm_code int,@UoM_NoofDecimal int declare @SOuD_CuBal as numeric(21,6) declare @newSOuD_CuBal as numeric(21,6) open cursor_deci fetch next from cursor_deci into @SOuD_CuBal,@Uom_Noofdecimal,@sm_code while (@@FETCH_STATUS =0) begin ''update #tmp2 SET cubal = CAST((@SOuD_CuBal) as decimal(18,@Uom_Noofdecimal) where sm_code = @sm_code fetch next from cursor_deci into @SOuD_CuBal,@Uom_Noofdecimal,@sm_code end close cursor_deci deallocate cursor_deci
declare @aa as decimal(18,2) =25000.545 select cast(@aa as int)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)