I have a simple query:
INSERT INTO tblIndicators (RunID, EventTS, MA1t3)
Values (65, '11/2/2012 2:25:00 AM', 1.0);
I get this error message:
Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The precision on the Decimal datatype is (8,8)
. So whats the problem??
In standard SQL, the syntax DECIMAL( M ) is equivalent to DECIMAL( M ,0) . Similarly, the syntax DECIMAL is equivalent to DECIMAL( M ,0) , where the implementation is permitted to decide the value of M . MySQL supports both of these variant forms of DECIMAL syntax. The default value of M is 10.
DECIMAL [(p[,s])] or DEC [(p[,s])]The DECIMAL data type accepts numeric values, for which you may define a precision and a scale in the data type declaration. The precision is a positive integer that indicates the number of digits that the number will contain.
decimal (8, 8)
means all 8 of your significant digits are to the right of the decimal point. 1.0 is too big.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With