Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Imagine we have a table:

create table MYTABLE (
 id int IDENTITY(1,1)
,name varchar(10)
)

We have to insert a lot of rows into the table.

Does anybody know what will happen when a generated identity value oversteps a maximal integer value (2^32-1)?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted
  1. You will get the following error:

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

  2. You won't be able to insert more records, until you:

share|improve this answer
2  
or alter the column to bigint? –  Gabriel Guimarães Jan 25 '11 at 11:50
1  
or decimal (20,0)? –  Tim Feb 1 '11 at 14:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.