Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Autoincrement limit

Author  Topic 

raxbat
Yak Posting Veteran

52 Posts

Posted - 2007-12-24 : 13:54:10
Hello all! What will be if autoincrement coulumn reachs its limit? What I should do to prevent my program for crash?

Thank You!

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-12-24 : 13:57:44
You should design the table so that the datatype on the IDENTITY column is large enough that you will never run out of numbers within the expected life of the application.



CODO ERGO SUM
Go to Top of Page

raxbat
Yak Posting Veteran

52 Posts

Posted - 2007-12-24 : 14:10:49
OK, but is this the only way to avoit that problem?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-12-24 : 16:25:29
If you delete many rows, can reseed the column with 'dbcc checkident'.
Go to Top of Page

georgev
Posting Yak Master

122 Posts

Posted - 2007-12-25 : 17:54:47
What datatype have you used..?

Go look up the limits for said datatype in BoL


George
<3Engaged!
Go to Top of Page

Jeff Moden
Aged Yak Warrior

652 Posts

Posted - 2007-12-26 : 22:02:32
quote:
Originally posted by raxbat

OK, but is this the only way to avoit that problem?



So, you plan on running out of 2 BILLION numbers with INT or 9,223 QUADRILLION numbers with BIGINT?

What is your real problem with the IDENTITY column???

--Jeff Moden
Go to Top of Page
   

- Advertisement -