[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

SQL Error Arithmetic overflow error converting numeric to data type numeric. The statement has been terminated

Posted on 2016-11-21
8
Medium Priority
?
45 Views
Last Modified: 2016-12-27
Hi. I am getting the following error in the SQL statement below. I have no idea why or what the error even means

Arithmetic overflow error converting numeric to data type numeric. The statement has been terminated

            INSERT INTO Performance ([Date], [Team Leader], Foreman, Supervisor, Shaft, [Machine Number], [Hole Number], Shift, [Machine Operator], [Assistant Operator], [Assistant Operator 2], [Assistant Operator 3], [Drilled From], [Drilled To], AXT, BX, NX, HQ, PQ, Setup,[Casing Pipes] ,[Wedge Bolts] ,[Drilled Total], [Drill Hours], [Travel Hours], [Transport Hours], [Delay Hours 1], [Delay Code 1], [Delay Hours 2], [Delay Code 2], [Delay Hours 3], [Delay Code 3], [Servicing Hours], [Total Hours], Rods, Bits, Shells, Remarks, [SAP Number], Description, [DescriptionID], [Quantity], [User] ) SELECT '11/14/2016' AS oDate, Lower('Null'), 'Null', '11127', Lower('kimberley lib '), 'lm90-1', Lower('dtp760/ex/003e'), Lower('m'), '15042','11182','11042','Null',2.1, 17.3, 0.00, 0, 0.00, 15.2, 0.00, 0.00, 0.00, 0.00, 15.2,0.00, 1, 0.00, 0.00, Lower('Null'),0.00, Lower('Null'),0.00, Lower('Null'),0.00, 12, 0.00, 'Null','Null','Safety1hr Travelling1hr drilling 8.5hrPulling and lowering 1.5hrs', '', 'Drilling HQ 0 - 100m', 350, '15.2', 'x'
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 32

Expert Comment

by:Pawan Kumar
ID: 41895537
Try..

 INSERT INTO Performance ([Date], [Team Leader], Foreman, Supervisor, Shaft, [Machine Number], [Hole Number], Shift, [Machine Operator]
 , [Assistant Operator], [Assistant Operator 2], [Assistant Operator 3], [Drilled From], 
 [Drilled To], AXT, BX, NX, HQ, PQ, Setup,[Casing Pipes] ,[Wedge Bolts] ,[Drilled Total], [Drill Hours], [Travel Hours], [Transport Hours], 
 [Delay Hours 1], [Delay Code 1], [Delay Hours 2], [Delay Code 2], [Delay Hours 3], [Delay Code 3], [Servicing Hours], [Total Hours], Rods, 
 Bits, Shells, Remarks, [SAP Number], Description, [DescriptionID], [Quantity], [User] ) 
 SELECT '11/14/2016', 
 NULL, NULL, 11127, 'kimberley lib ', 'lm90-1', 'dtp760/ex/003e', 'm', 15042,11182,11042,NULL
 ,2.1, 17.3, 0.00, 0, 0.00, 15.2, 0.00, 0.00, 0.00, 0.00, 15.2,0.00, 1, 0.00, 0.00, NULL,0.00, NULL,0.00, NULL,0.00, 12, 0.00,
  NULL,NULL,'Safety1hr Travelling1hr drilling 8.5hrPulling and lowering 1.5hrs', 0, 'Drilling HQ 0 - 100m', 350, 15.2, 'x'

Open in new window

0
 

Author Comment

by:Murray Brown
ID: 41895559
Hi. Thanks but I get the same error
0
 
LVL 32

Expert Comment

by:Pawan Kumar
ID: 41895560
Can you please post the Schema for your table?
column names with their datatypes
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Murray Brown
ID: 41895581
Schema.xlsx

Please see the attached Excel file for the schema
0
 
LVL 32

Expert Comment

by:Pawan Kumar
ID: 41895658
Try this

INSERT INTO Performance 
(
[Assistant Operator],[Assistant Operator 2],[Assistant Operator 3],[AXT],[Bits],[Blank Cap],[BX],[Casing Pipes],
[Category],[Code],[Concrete Redrill],[Date],[Day Rate],[Delay Code 1],[Delay Code 2],[Delay Code 3],[Delay Hours 1],
[Delay Hours 2],[Delay Hours 3],[Description],[DescriptionID],[Drill Hours],[Drilled From],[Drilled To],[Drilled Total],
[DWR Hours],[Extra],[Extra2],[Foreman],[Grout Hours],[Grouting Borehole],[Hole Number],[HQ],[ID],[Interhole Move],[Machine number],
[Machine operator],[Mobilise],[NX],[Photographic Survey],[Plugging],[PQ],[Quantity],[Remarks],[Rock Redrill],[Rods],[SAP Number],
[Servicing Hours],[Set Up Stope],[Setup],[Shaft],[Shells],[Shift],[Standing Time],[Supervisor],[Team Leader],[Total Hours],
[Transport Hours],[Travel Hours],[Trp Equip UG],[User],[Wedge Bolts] )

SELECT N'',N'',N'',0.00,N'',0,0.00,0.00,N'',N'',0.00,CAST(GETDATE() AS DATE),0.00,N'',N'',N'',0.00,0.00,0.00,N'',0,0.0,0.0,0.0,0.0,0.0,N'',N'',N'',0.0,0.0,N'',0.0,
1,0.0,N'',N'',0,0.0,0.0,0.0,0.0,N'',0.0,0.0,N'',0.0,0.0,0.0,N'',N'',N'',0.0,N'',N'',0.0,0.0,0.0,0.0,N'',0.0

Open in new window

0
 

Author Comment

by:Murray Brown
ID: 41895671
The select list contains fewer items than the insert list
0
 
LVL 32

Accepted Solution

by:
Pawan Kumar earned 2000 total points
ID: 41895684
Try..

INSERT INTO Performance 
(
[Assistant Operator],[Assistant Operator 2],[Assistant Operator 3],[AXT],[Bits],[Blank Cap],[BX],[Casing Pipes],
[Category],[Code],[Concrete Redrill],[Date],[Day Rate],[Delay Code 1],[Delay Code 2],[Delay Code 3],[Delay Hours 1],
[Delay Hours 2],[Delay Hours 3],[Description],[DescriptionID],[Drill Hours],[Drilled From],[Drilled To],[Drilled Total],
[DWR Hours],[Extra],[Extra2],[Foreman],[Grout Hours],[Grouting Borehole],[Hole Number],[HQ],[ID],[Interhole Move],[Machine number],
[Machine operator],[Mobilise],[NX],[Photographic Survey],[Plugging],[PQ],[Quantity],[Remarks],[Rock Redrill],[Rods],[SAP Number],
[Servicing Hours],[Set Up Stope],[Setup],[Shaft],[Shells],[Shift],[Standing Time],[Supervisor],[Team Leader],[Total Hours],
[Transport Hours],[Travel Hours],[Trp Equip UG],[User],[Wedge Bolts] )

SELECT 

N'' [Assistant Operator],N'' [Assistant Operator 2],N'' [Assistant Operator 3], 0 [AXT],N'' [Bits], 0 [Blank Cap], 0.0 [BX], 0 [Casing Pipes],
N'' [Category],N'' [Code], 0 [Concrete Redrill], CAST(GETDATE() AS DATE) [Date], 0 [Day Rate],N'' [Delay Code 1],N'' [Delay Code 2],N'' [Delay Code 3]
, 0 [Delay Hours 1], 0 [Delay Hours 2],0 [Delay Hours 3],N'' [Description], 0 [DescriptionID], 0 [Drill Hours], 0 [Drilled From], 0 [Drilled To], 0 [Drilled Total],
0 [DWR Hours],N'' [Extra],N'' [Extra2],N'' [Foreman],0 [Grout Hours], 0 [Grouting Borehole],N'' [Hole Number], 0 [HQ], 0 [ID],0 [Interhole Move],N'' [Machine number],
N'' [Machine operator],0 [Mobilise],0 [NX],0 [Photographic Survey],0 [Plugging],0 [PQ],0 [Quantity],N'' [Remarks],0 [Rock Redrill],0 [Rods],N'' [SAP Number],
0 [Servicing Hours],0 [Set Up Stope],0 [Setup],N'' [Shaft],N'' [Shells],N'' [Shift],0 [Standing Time],N'' [Supervisor],N'' [Team Leader],0 [Total Hours],
0 [Transport Hours],0 [Travel Hours],0 [Trp Equip UG],N'' [User],0 [Wedge Bolts]

Open in new window

0
 

Author Closing Comment

by:Murray Brown
ID: 41895734
Thanks very much
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question