none
An error occurred while executing batch. Error message is: Arithmetic Overflow.

    Question

  • Dear Friends,
    I have Table named Transcation_Master. It has approx 700000 Records (7 Lacs).
    Now When I try to run following query.
    Select * from Transcation_Master. Where ObjectID=11931
    It Gives me error
    An error occurred while executing batch. Error message is: Arithmetic Overflow.

    I executes DBCC CheckDB procedure on my Database with all possible options
    But still It gives error.
    Does any one has solution?

    Thnxs
    Wednesday, December 09, 2009 8:34 AM

Answers

  • Do you have a computed column in the table which could give the error message?

    Demo follows:

    -- T-SQL computed column error in SELECT
    USE tempdb;
    CREATE TABLE ComputedColumn (
    ID TINYINT IDENTITY (1,1) PRIMARY KEY,
    [Cube] as ID*ID*ID)
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    
    SELECT * FROM ComputedColumn
    /*
    Msg 8115, Level 16, State 2, Line 1
    Arithmetic overflow error converting expression to data type tinyint.
    */
    GO
    DROP TABLE ComputedColumn

    Kalman Toth, SQL Server & BI Training, SSAS, SSIS, SSRS; http://www.SQLUSA.com
    Tuesday, December 15, 2009 8:22 AM
    Moderator

All replies

  • Can you provide the schema of the table? In particular the objectid datatype.

    Wednesday, December 09, 2009 8:37 AM
  • what is the data type of objectID?

    Best Regards,
    Melissa Suciadi


    If you have found this post helpful, please click the 'Vote as Helpful' link (the green triangle and number on the top-left).

    If this post answers your question, click the 'Mark As Answered' link below. It helps others who experience the same issue in future to find the solution.

    Wednesday, December 09, 2009 8:38 AM

  • Hi

    Let us know what is the data type of the object
    Wednesday, December 09, 2009 8:53 AM
  • Hi Viren,



    This  could be due to  the size of  OBJECT ID. Resizing the  field  would help you. (not recommened but this helps)

    Do provide the Data type of the filed which could help  to resolve this..


    Thanks
    Ramakrishna
    If you have found this post helpful, please click the 'Vote as Helpful'
    If this post answers your question, click the 'Mark As Answered' link below.
    Wednesday, December 09, 2009 9:01 AM
  • Do you have a computed column in the table which could give the error message?

    Demo follows:

    -- T-SQL computed column error in SELECT
    USE tempdb;
    CREATE TABLE ComputedColumn (
    ID TINYINT IDENTITY (1,1) PRIMARY KEY,
    [Cube] as ID*ID*ID)
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    INSERT ComputedColumn DEFAULT VALUES
    
    SELECT * FROM ComputedColumn
    /*
    Msg 8115, Level 16, State 2, Line 1
    Arithmetic overflow error converting expression to data type tinyint.
    */
    GO
    DROP TABLE ComputedColumn

    Kalman Toth, SQL Server & BI Training, SSAS, SSIS, SSRS; http://www.SQLUSA.com
    Tuesday, December 15, 2009 8:22 AM
    Moderator