all groups > sql server new users > march 2005 >
You're in the

sql server new users

group:

Arithmetic overflow error - in a changed table!


Arithmetic overflow error - in a changed table! volps NO[at]SPAM hotmail.com
3/23/2005 7:23:17 AM
sql server new users:
Hello.

I had a table with identity column set to datatype [smallint]. I've
reached near 32800 records. That's the limit for [smallint].

So, I've changed the identity datatype to [int], that SHOULD allow me
to have more records. But the error continues.

"Arithmetic overflow error converting expression to data type
smallint".

AND there's no smallint anymore. It's weird. See by yourself:

-------------------
CREATE TABLE [forum] (
[forumid] [int] IDENTITY (1, 1) NOT NULL ,
[forumdata] [smalldatetime] NOT NULL CONSTRAINT [DF_forum_forumdata]
DEFAULT (getdate()),
[forumnome] [varchar] (100) NULL ,
[forumemail] [varchar] (100) NULL ,
[forumidade] [varchar] (50) NULL ,
[forumcidade] [varchar] (100) NULL ,
[forummensagem] [varchar] (1000) NULL ,
[forumstatus] [bit] NULL CONSTRAINT [DF_forum_forumstatus] DEFAULT
(1),
[forumip] [char] (15) NULL ,
CONSTRAINT [PK_forum] PRIMARY KEY CLUSTERED
(
[forumid]
) ON [PRIMARY]
) ON [PRIMARY]

------------------

Am I missing something? Should I need to execute some kind of
Re: Arithmetic overflow error - in a changed table! Enric
3/23/2005 7:51:05 AM
Hi Rodrigo,

It's very strange without a doubt. One solution should be simply do the
following steps:

1)select * into forum20050323 from forum
2)truncate table forum
3)insert into forum
select (do just sp_help forum in order to get all the filed but leaving off
the identity field)
from forum20050323

truncate command is bearing on mind the original values on a identity field.

Let me know your doubts or concerns with this.

See you later,


[quoted text, click to view]
Re: Arithmetic overflow error - in a changed table! Denis
3/23/2005 10:24:01 AM
I might be a variable that you are using in one of you sp where you do the
insert

[quoted text, click to view]

Re: Arithmetic overflow error - in a changed table! Bob Barrows [MVP]
3/23/2005 10:49:56 AM
Show us how to get that error.

[quoted text, click to view]

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Arithmetic overflow error - in a changed table! Dan Guzman
3/23/2005 8:30:22 PM
Check for triggers on the table.

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]

AddThis Social Bookmark Button