Connecting Tech Pros Worldwide Forums | Help | Site Map

identity column (int) overflow

Newbie
 
Join Date: Jun 2009
Posts: 31
#1: Oct 13 '09
If identity column is of type 'int' we can address upto 2147483647 after that if we want to insert a new record it throws an exception

Msg 8115, Level 16, State 1, Line 2
Arithmetic overflow error converting IDENTITY to data type int.
Arithmetic overflow occurred.

what is the alternate method for continuing the insertion of new records

ssnaik84's Avatar
Member
 
Join Date: Aug 2009
Location: Bengaluru, India
Posts: 124
#2: Oct 13 '09

re: identity column (int) overflow


change data type to "bigint" :)
Newbie
 
Join Date: Jun 2009
Posts: 31
#3: Oct 13 '09

re: identity column (int) overflow


if i use bigint than it stops at 9,223,372,036,854,775,807 after that if i insert record it gives error. My question is if identity column reaches max value than what next?
ssnaik84's Avatar
Member
 
Join Date: Aug 2009
Location: Bengaluru, India
Posts: 124
#4: Oct 13 '09

re: identity column (int) overflow


if you are thinking in this way.. then GUID is only your solution..
but, its data type is string
Newbie
 
Join Date: Jun 2009
Posts: 31
#5: Oct 14 '09

re: identity column (int) overflow


Thanks for your suggestion. It helped me really a lot.
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#6: Oct 14 '09

re: identity column (int) overflow


That's one big table. Try considering revising the design. You might be able to accommodate the creation of your PK, but the performance might suffer.

Just a thought.....

Happy Coding!!!


--- CK
Reply


Similar Microsoft SQL Server bytes