Why SQL Server throws Arithmetic overflow error converting int to data type numeric? Why SQL Server throws Arithmetic overflow error converting int to data type numeric? sql-server sql-server

Why SQL Server throws Arithmetic overflow error converting int to data type numeric?


Numeric defines the TOTAL number of digits, and then the number after the decimal.

A numeric(3,2) can only hold up to 9.99.


Lets see, numeric (3,2). That means you have 3 places for data and two of them are to the right of the decimal leaving only one to the left of the decimal. 15 has two places to the left of the decimal. BTW if you might have 100 as a value I'd increase that to numeric (5, 2)


NUMERIC(3,2) means: 3 digits in total, 2 after the decimal point. So you only have a single decimal before the decimal point.

Try NUMERIC(5,2) - three before, two after the decimal point.