Solved

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

Posted on 2016-11-21
8
10 Views
Last Modified: 2016-11-21
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:murbro
  • 4
  • 4
8 Comments
 
LVL 18

Expert Comment

by:Pawan Kumar Khowal
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:murbro
ID: 41895559
Hi. Thanks but I get the same error
0
 
LVL 18

Expert Comment

by:Pawan Kumar Khowal
ID: 41895560
Can you please post the Schema for your table?
column names with their datatypes
0
 

Author Comment

by:murbro
ID: 41895581
Schema.xlsx

Please see the attached Excel file for the schema
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 18

Expert Comment

by:Pawan Kumar Khowal
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:murbro
ID: 41895671
The select list contains fewer items than the insert list
0
 
LVL 18

Accepted Solution

by:
Pawan Kumar Khowal earned 500 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:murbro
ID: 41895734
Thanks very much
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now