Results 1 to 3 of 3

Thread: Arithmetic overflow occurred on insert query

  1. #1
    Henry Koren Guest

    Arithmetic overflow occurred on insert query

    Ok I'm doing a simple insert query:

    insert into product(CategoryID, StoreID, MallCategoryID, ProductName, Manufacturer, ProductItemNumber, Size, Color, SizeApplies, ColorApplies, Price, Discontinued, ProductDescription, GiftWrapping, Gender, Age, MinAge, MaxAge, Tax, Shipping)
    values(100, 100, 80, 'test product Casdfasdf', 'test manufacturer', 'est', '', '', 0, 0, 99.95, 0, 'test desc', 0, 'Both', '', '0', '0', 0, 0)

    I get this error:

    Arithmetic overflow occurred.

    It dosn't make sense that this would happen because the number fields are not huge at all.

    Any ideas...?

    here's the table layout:

    CREATE TABLE dbo.Product (
    ProductID smallint IDENTITY (1, 1) NOT NULL ,
    ProductName varchar (100) NULL ,
    Gender varchar (10) NULL ,
    ProductDescription varchar (255) NULL ,
    Manufacturer varchar (75) NULL ,
    ProductItemNumber varchar (50) NULL ,
    Tax bit NOT NULL ,
    Shipping bit NOT NULL ,
    ApproxWeight varchar (10) NULL ,
    MallCategoryID smallint NULL ,
    GiftWrapping bit NOT NULL ,
    ShippingCost decimal(18, 2) NULL ,
    GiftWrappingCost decimal(18, 2) NULL ,
    ImageName varchar (25) NULL ,
    Price decimal(18, 2) NULL ,
    SizeApplies bit NOT NULL ,
    ColorApplies bit NOT NULL ,
    Age varchar (20) NULL ,
    StoreID smallint NULL ,
    CategoryID smallint NULL ,
    Discontinued bit NOT NULL ,
    MinAge varchar (5) NULL ,
    MaxAge varchar (5) NULL ,
    Size text NULL ,
    Color text NULL
    )

    THANKS!!!!

  2. #2
    M Guest

    Arithmetic overflow occurred on insert query (reply)

    Odds are good your IDENTITY column has reached it's max value. Excessive inserts/deletes will cause this value to increment internally even if you have deleted all the records in the table.
    Run DBCC CHECKIDENT(tablename) to reset the column or recreate the table with the identity column under a bigger datatype.


    ------------
    Henry Koren at 11/24/99 4:13:49 PM

    Ok I'm doing a simple insert query:

    insert into product(CategoryID, StoreID, MallCategoryID, ProductName, Manufacturer, ProductItemNumber, Size, Color, SizeApplies, ColorApplies, Price, Discontinued, ProductDescription, GiftWrapping, Gender, Age, MinAge, MaxAge, Tax, Shipping)
    values(100, 100, 80, 'test product Casdfasdf', 'test manufacturer', 'est', '', '', 0, 0, 99.95, 0, 'test desc', 0, 'Both', '', '0', '0', 0, 0)

    I get this error:

    Arithmetic overflow occurred.

    It dosn't make sense that this would happen because the number fields are not huge at all.

    Any ideas...?

    here's the table layout:

    CREATE TABLE dbo.Product (
    ProductID smallint IDENTITY (1, 1) NOT NULL ,
    ProductName varchar (100) NULL ,
    Gender varchar (10) NULL ,
    ProductDescription varchar (255) NULL ,
    Manufacturer varchar (75) NULL ,
    ProductItemNumber varchar (50) NULL ,
    Tax bit NOT NULL ,
    Shipping bit NOT NULL ,
    ApproxWeight varchar (10) NULL ,
    MallCategoryID smallint NULL ,
    GiftWrapping bit NOT NULL ,
    ShippingCost decimal(18, 2) NULL ,
    GiftWrappingCost decimal(18, 2) NULL ,
    ImageName varchar (25) NULL ,
    Price decimal(18, 2) NULL ,
    SizeApplies bit NOT NULL ,
    ColorApplies bit NOT NULL ,
    Age varchar (20) NULL ,
    StoreID smallint NULL ,
    CategoryID smallint NULL ,
    Discontinued bit NOT NULL ,
    MinAge varchar (5) NULL ,
    MaxAge varchar (5) NULL ,
    Size text NULL ,
    Color text NULL
    )

    THANKS!!!!

  3. #3
    Henry Koren Guest

    Arithmetic overflow occurred on insert query (reply)

    Thanks, I just discovered that the table had 32667 records in it... the limit for the smallint's primary key


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •