?
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
?
33 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 29

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 29

Expert Comment

by:Pawan Kumar
ID: 41895560
Can you please post the Schema for your table?
column names with their datatypes
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

Author Comment

by:Murray Brown
ID: 41895581
Schema.xlsx

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

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 29

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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

752 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