| | |
inserting decimal values failing
Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jul 2008
Posts: 25
Reputation:
Solved Threads: 0
I have setup the following table:-
and now I am trying to execute the following insert statement in Enterprise Manager
and it fails with
Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
I do not understand the necessity of converting numeric to numeric.
Please tell me what I have done wrong.
MS SQL Syntax (Toggle Plain Text)
IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'TlHold') DROP TABLE THold GO CREATE TABLE THold ( pid int NOT NULL IDENTITY(1,1), TS NUMERIC(2,2) NOT NULL, TR NUMERIC(2,2) NOT NULL, TB NUMERIC(2,2) NOT NULL, TP NUMERIC(2,2) NOT NULL, TP2 NUMERIC(2,2) NOT NULL, filler1 NUMERIC(2,2) NOT NULL, filler2 NUMERIC(2,2) NOT NULL, filler3 NUMERIC(2,2) NOT NULL, PRIMARY KEY (pid) );
and now I am trying to execute the following insert statement in Enterprise Manager
MS SQL Syntax (Toggle Plain Text)
INSERT INTO THold VALUES (5.40, 2.40, 1.00, 1.15, 2.40, 0,0,0);
and it fails with
Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
I do not understand the necessity of converting numeric to numeric.
Please tell me what I have done wrong.
Last edited by stockton; Sep 12th, 2008 at 11:58 am. Reason: misspelling
Regards,
Alf Stockton www.stockton.co.za
Alf Stockton www.stockton.co.za
•
•
Join Date: Aug 2008
Posts: 1,160
Reputation:
Solved Threads: 137
your total digits on each column is 2
also use columns when inserting
also use columns when inserting
MS SQL Syntax (Toggle Plain Text)
INSERT INTO theoritcalHold (TS, TR, ...etc) VALUES(.....)
Last edited by dickersonka; Sep 12th, 2008 at 12:04 pm.
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
•
•
Join Date: Jul 2008
Posts: 25
Reputation:
Solved Threads: 0
definition of fields is wrong at 2,2 should be at lease 3,2
Regards,
Alf Stockton www.stockton.co.za
Alf Stockton www.stockton.co.za
![]() |
Other Threads in the MS SQL Forum
- Previous Thread: SQL Query join rows help
- Next Thread: Convert string decimal to HEX, reverse, then convert back to string decimal.
| Thread Tools | Search this Thread |






