Thursday, February 16, 2012

Arithmetic Overflow error

Can someone help me with this error:

I need to change the datatype of a column from int to tinyint.

I did this :

ALTER TABLE EmailTracking ALTER COLUMN URLID tinyint

and got this error:

Msg 220, Level 16, State 2, Line 1

Arithmetic overflow error for data type tinyint, value = 74860.

The statement has been terminated.

how do i fix this?

thanks

Rookie, perhaps you could try examining the maximum value on the data. Tinyint is only up to 255. If the maximum of your data is more than 255, perhaps you would consider smallint instead, which is up to 32,000. Int on the other hand, is up to 2 billion.
Also, please check for negative values. Tinyint does not allow negative values, but smallint and int do.
Vincent

No comments:

Post a Comment