Re: Newbie question

From: mountain man <hobbit_at_southern_seaweed.com.op>
Date: Thu, 16 Jun 2005 09:44:12 GMT
Message-ID: <MRbse.18443$F7.4534_at_news-server.bigpond.net.au>


"panther" <nessuna_at_mailinator.com> wrote in message news:1118911917.946438.254180_at_g47g2000cwa.googlegroups.com...
> Hi,
> I'd like to know what happens when a counter field defined as "primary
> key" runs into overflow (very big number).

Here are one (MS SQL) sample classification for the integer data type ....

bigint: Integer (whole number) data from -2^63 (-9223372036854775808) through 2^63-1 (9223372036854775807). Storage size is 8 bytes.

int: Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647). Storage size is 4 bytes. The SQL-92 synonym for int is integer.

smallint: Integer data from -2^15 (-32,768) through 2^15 - 1 (32,767). Storage size is 2 bytes.

tinyint: Integer data from 0 through 255. Storage size is 1 byte.

An overflow will happen to a tinyint type when the increment exceeds 255, for the smallint type when the increment exceeds 32767, and so forth all the way up the scale.

> How is it managed?

The overflow is managed by increasing the integer bound to the next higher classification. See the scales applicable above

ie: Simply change the integer type.

-- 
Pete Brown
IT Managers & Engineers
Falls Creek
Australia
www.mountainman.com.au
Received on Thu Jun 16 2005 - 11:44:12 CEST

Original text of this message