Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8426709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:36:14+00:00 2026-06-10T04:36:14+00:00

I obtain on my SQL Server 2005 an error Server: Msg 8115, Arithmetic overflow

  • 0

I obtain on my SQL Server 2005 an error

Server: Msg 8115, 
Arithmetic overflow error converting numeric to data type numeric.

When I try to insert a value = X(DECIMAL(3,2)) * Y(INT)
in a column MYCOLUMN typed DECIMAL (10,3)

How to workaround this problem?

UPDATE

some code bellow to understand the situation

-- ============================================================
--   Table : GP_WGENTH
-- ============================================================
CREATE TABLE #GP_WGENTH
(
     KEYINTERNAL                     CHAR(32)              NOT NULL,
     KEYHOUR                         INT                   NOT NULL,
     FIRM                            CHAR(5)               NOT NULL,
     CENTRE                          CHAR(2)               NOT NULL,
     SERVICE                         CHAR(6)               NOT NULL,
     AGENT                           CHAR(5)               NOT NULL,
     VERSION                         VARCHAR(3)            NOT NULL,
     DATE_ROULEMENT                  DATETIME              NOT NULL,
     SERVICEINSTANCE                 SMALLINT              NOT NULL,
     TYPEHOUR                        CHAR(9)               NOT NULL,
     QUANTITEFIXE                    DECIMAL(12,2)         NULL    ,
     TYPECMP                         INT                   NULL    ,
     PERCENTCALC                     DECIMAL(3,2)          NULL    
)
-- ============================================================
--   Table : GP_WGENSVCTH
-- ============================================================
CREATE TABLE #GP_WGENSVCTH
(
    KEYINTERNAL                     CHAR(32)              NOT NULL,
    KEYHOUR                         INT                   NOT NULL,
    FIRM                            CHAR(5)               NOT NULL,
    CENTRE                          CHAR(2)               NOT NULL,
    SERVICE                         CHAR(6)               NOT NULL,
    AGENT                           CHAR(5)               NOT NULL,
    VERSION                         VARCHAR(3)            NOT NULL,
    DATE_ROULEMENT                  DATETIME              NOT NULL,
    SERVICEINSTANCE                 SMALLINT              NOT NULL,
    TYPEHOUR                        CHAR(9)               NOT NULL,
    VALUE                           DECIMAL(10,3)         NOT NULL
)
GO

INSERT INTO #GP_WGENSVCTH 
            (KEYINTERNAL, 
             KEYHOUR, 
             FIRM, 
             CENTRE, 
             SERVICE, 
             AGENT, 
             VERSION, 
             DATE_ROULEMENT, 
             SERVICEINSTANCE, 
             TYPEHOUR, 
             VALUE) 
SELECT WTH.KEYINTERNAL, 
       WTH.KEYHOUR, 
       WTH.FIRM, 
       WTH.CENTRE, 
       WTH.SERVICE, 
       WTH.AGENT, 
       WTH.VERSION, 
       WTH.DATE_ROULEMENT, 
       WTH.SERVICEINSTANCE, 
       WTH.TYPEHOUR, 
       WTH.PERCENTCALC * SUM(SC.LENGTH) -- !!! BOOOM !!!!!!!!! HERE
FROM   #GP_WGENTH WTH 
       INNER JOIN GP_SERVICE_HABILLAGE_COMPONENT SC 
               ON WTH.FIRM = SC.FIRM 
                  AND WTH.CENTRE = SC.CENTRE 
                  AND WTH.SERVICE = SC.SERVICE 
                  AND WTH.VERSION = SC.VERSION 
                  AND WTH.TYPECMP = SC.TYPECMP 
WHERE  WTH.KEYINTERNAL = 'august 23 2012  10:45:21:027PM     ' 
       AND SC.LENGTH IS NOT NULL 
GROUP  BY WTH.KEYINTERNAL, 
          WTH.KEYHOUR, 
          WTH.FIRM, 
          WTH.CENTRE, 
          WTH.SERVICE, 
          WTH.AGENT, 
          WTH.VERSION, 
          WTH.DATE_ROULEMENT, 
          WTH.SERVICEINSTANCE, 
          WTH.TYPEHOUR, 
          WTH.PERCENTCALC 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:36:16+00:00Added an answer on June 10, 2026 at 4:36 am

    The rules for the necessary scale, precision and length are well covered in MSDN documentation.

    Decimal is just a scaled integer, so let’s look at an example with no decimal point.

    For example X DECIMAL(3, 0) and Y DECIMAL(3, 0) where X = 100 and Y = 100, X * Y = 10000 which will not fit in DECIMAL(3, 0), and requires DECIMAL(5, 0). In fact, 999 * 999 = 998001 which would require DECIMAL(6, 0).

    So trying to insert the result of multiplying two decimal columns will only fit if the destination column has a capacity at least as great as that indicated by the formulas in the MSDN table for the different operations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've managed to obtain the report definition schema for SQL Server 2005, but cannot
I'm using the INFORMATION_SCHEMA views in Sql Server 2005 & 2008 to obtain metadata
I am trying to insert the data from this link to my SQL server
I am using VS2005 C# 2.0 and SQL Server 2005. I am referring to
We are using a SQL Server Data-tier application (dacpac or DAC pack) and I'm
I am using Access 2003 to access data stored in a SQL Server database
I'm using the following code block to call a SQL Server 2005 stored procedure.
Imagine the following schema and sample data (SQL Server 2008): OriginatingObject ---------------------------------------------- ID 1
I'm working on converting a stored procedure from SQL server to Oracle. This stored
I want to INSERT a record in a database (which is Microsoft SQL Server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.