Devildog74 wrote:
good question, but you could define the table, set identity insert on, insert 1 row that is 1 digit prior to the max.
then turn off identity indert, and do another insert. should be a 5 minute test.
I tested this and as expected you get an arithmetic overflow.
create table testmaxint (pk int primary key identity(2147483645, 1), label varchar(100))
go
INSERT INTO testmaxint (label) VALUES ('First record')
INSERT INTO testmaxint (label) VALUES ('Second record')
INSERT INTO testmaxint (label) VALUES ('Third record')
INSERT INTO testmaxint (label) VALUES ('Fourth record')
go
The indentity will not restart.
Using a TRUNCATE TABLE will reset to the original seed, which in my example only gave me 3 good inserts. Your best bet is starting with a seed of the lowest limit of the int with a value of -2,147,483,647 which will allow about 4.3 billion unique values.
Of course, if you could add into your maintenance plan some way to TRUNCATE the table, perhaps weekly or whatever you would never have a problem.
BOb