sql server - How to multiply a large number in sql with out getting a "overflow error " error -
i know maybe silly question; how multiply large numbers in sql server without getting error:
arithmetic overflow error converting expression data type int
i need take column contains list of 6 digit client numbers.
e.g. 123456, 123457 , make 1234560000000, 1234570000000 & etc.
this tried doing.
update account set sclientidno = sclientidno * 100000000
but end overflow error. appreciated.
edit: forgot mention column contained client numbers had varchar data type.
i can suggest use numeric
type this:
declare @a numeric(14, 0) = 123456 select @a * 100000000
note use 14
requirement can use bigger values precision.
Comments
Post a Comment