Ok, I've got a database that my code interacts with quite a bit that was setup with an auto-incrementing integer as it's primary key. Now personally, in my own databases I've become a firm believer in using GUID's, but since my code is not the only software hitting this DB I can't change the design.
I know this sounds like an ignorant question, but given that I'm inserting and deleting a decent # of records from this database (on the order of a few hundred thousand per day), I got to thinking: what happens when the primary key being used overflows over what can be stored in a 32-bit integer? Most of the records that are inserted eventually get deleted so there will be plenty of "space" left if the sequence wraps and starts using unused numbers again, but I wasn't sure if that would happen.
Thanks.
EDIT: Gah - sorry, in my haste I forgot to mention which DBMS I was using. I'm on MS SQL Server 2005.
I know this sounds like an ignorant question, but given that I'm inserting and deleting a decent # of records from this database (on the order of a few hundred thousand per day), I got to thinking: what happens when the primary key being used overflows over what can be stored in a 32-bit integer? Most of the records that are inserted eventually get deleted so there will be plenty of "space" left if the sequence wraps and starts using unused numbers again, but I wasn't sure if that would happen.
Thanks.
EDIT: Gah - sorry, in my haste I forgot to mention which DBMS I was using. I'm on MS SQL Server 2005.
Last edited: