Solved

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

Posted on 2016-11-21
8
28 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:murbro
[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 28

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:murbro
ID: 41895559
Hi. Thanks but I get the same error
0
 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41895560
Can you please post the Schema for your table?
column names with their datatypes
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

Author Comment

by:murbro
ID: 41895581
Schema.xlsx

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

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:murbro
ID: 41895671
The select list contains fewer items than the insert list
0
 
LVL 28

Accepted Solution

by:
Pawan Kumar 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

Technology Partners: 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!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
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.

726 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