0

I have setup the following table:-

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

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.

2
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by stockton
0

your total digits on each column is 2

also use columns when inserting

insert into theoritcalHold (TS, TR, ...etc) values(.....)
1

definition of fields is wrong at 2,2 should be at lease 3,2

Votes + Comments
Thank you for sharing your solution
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.