Solved

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

Posted on 2016-11-21
8
20 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
  • 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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…
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.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

786 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