Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Arithmetic overflow error for type int, value=????

Author  Topic 

ZarrinPour
Yak Posting Veteran

66 Posts

Posted - 2007-06-11 : 14:55:23
Hi all
Today I'm so incredibly annoyed.
I have a simple Table which has one Identity column plus an integer Column with Unique constraint and some varchar fields.When i change the value of that Unique Constraint Column , the value will change successfully But today i find a record (Just By Chance) that when i change the value of its filed i recieve the following Error: its filed has the value of 2519 and i wanted to update it to 2520 !!!

---------------------------
SQL Server Enterprise Manager
---------------------------
[Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow error for type int, value = 6262227669.000000.

[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.
---------------------------
OK Help
---------------------------

As i said earlier i have no problem with other records , that's strange.

Could anyone help me Please?

Thanks in advance.
Kind Regards.

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-06-11 : 16:17:07
How are you changing the value?

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

ZarrinPour
Yak Posting Veteran

66 Posts

Posted - 2007-06-12 : 00:26:37
quote:
Originally posted by dinakar

How are you changing the value?

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/



Hi Dinakar
Thanks 4 ur reply
It doesn't matter , Through DML (Update ...Set ...) or through Enterprise manager , Both of them will cause the above Error

Kind Regards.
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-06-12 : 00:46:01
what is the DDL for the table? is there a trigger or computed column on the table?


elsasoft.org
Go to Top of Page

ZarrinPour
Yak Posting Veteran

66 Posts

Posted - 2007-06-12 : 01:54:46
quote:
Originally posted by jezemine

what is the DDL for the table? is there a trigger or computed column on the table?


elsasoft.org



Here is the Script of my Table

CREATE TABLE [Acc9] (
[Acc9_Pkey] [int] IDENTITY (1, 1) NOT NULL ,
[Acc9_Selected] [bit] NULL ,
[Acc9_Date] [varchar] (10) COLLATE SQL_Latin1_General_CP1256_CI_AS NULL ,
[Acc9_No1] [int] NULL ,
[Acc9_No2] [int] NULL ,
[Acc9_Desc] [varchar] (200) COLLATE SQL_Latin1_General_CP1256_CI_AS NULL ,
[Acc1_Pkey] [int] NULL ,
[Acc5_Pkey] [int] NULL ,
[UserPkey] [int] NOT NULL ,
[SystemCode] [int] NOT NULL ,
[Acc9_ISConfirmed] [bit] NOT NULL ,
[Acc9_RealPkey] [int] NULL ,
[Acc9_Saved] [bit] NULL CONSTRAINT [DF_Acc9_Acc9_Saved] DEFAULT (0),
CONSTRAINT [PK_Acc9] PRIMARY KEY CLUSTERED
(
[Acc9_Pkey]
) ON [PRIMARY] ,
CONSTRAINT [IX_Acc9] UNIQUE NONCLUSTERED
(
[Acc9_RealPkey]
) ON [PRIMARY]
) ON [PRIMARY]
GO


And this is my DML script
Update acc9_Set Acc9_RealPkey=2520 where Acc9_Pkey=something

That's it.

I'm lloking forward to hearing from you
Regards.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-12 : 08:54:28
I think that should work without error
Are you sure this is the statement that gives error?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -