Board index » delphi » large numbered primary keys
Tim Chemaly
![]() Delphi Developer |
Tue, 26 Apr 2005 19:09:52 GMT
large numbered primary keys
Hi
I have a table with a primary that is of typ INT. However each month a large number of transactions are processed. I'm thinking in terms of possible billions! For instance Mobile Network Operators send a few billion SMS each month! How can one prevent the primary key from over clocking back to zero? Would it be best to have a primary key that is a combination of the YEAR,MONTH and some sequence number (SEQ_ID)? In this case the next SEQ_ID is obtained using... SELECT MAX(SEQ_ID)+1 FROM MY_TABLE WHERE (THE_YEAR=2002 AND THE_MONTH=10); How else could one overcome this problem? Bye -- Regards --------------------------------------------------------- Solarworks |