sql - How to preserve decimal precision in stored procedure? -
i have column datatype decimal(10,2) in table , when try update column in stored procedure losing 2 digit precision.
if update field single query, works fine, in stored procedure loses precision.
example:
update table set decimal(10,2) column = decimal(10, 2) column / 100 example: 197.50 when updated results in 197.00
thanks
i think, in rdmbs run-time conversion automatically done on column / 100 that:
columnin decimal format and100not in decimal format
so solution changing 100 decimal format 1 of these:
100.00cast(100 decimal(10, 2))(decimal(10, 2) 100)
Comments
Post a Comment