4 Replies Latest reply on May 1, 2014 9:00 AM by philmodjunk

    unique number



      unique number


           hi guys,

           in my table i need unique number for each record (id).the problem is when im going to delete a record the id didnt reduce.if i need to delete the record 10 with id number 10 when i entire new record the id number will be 11 not 10.

        • 1. Re: unique number

               The id can be any number, sequential or not, but still ever unique.
               Its sequence is not important, nor should it be seen by the end user.

          • 2. Re: unique number

                 Is there a reason why you want your numbers to be perfectly sequential? (I can think of several)

                 If you can describe that reason, we can recommend ways to handle that issue.

            • 3. Re: unique number

                   when i'm finding a record sometimes i need to look the previous and next record also.

              • 4. Re: unique number

                     That does not require a perfectly sequenced series of auto-entered serial numbers to do.

                     You simply need to refer to the record with the largest serial number value that is less than that of the current record to refer to the previous record or the record with the smallest serial number that is greater than that of the current record to refer to the next record.

                     This usually a better option as often records get deleted from the middle of the series and trying to renumber everything to eliminate the gap in the series can be a real challenge to do successfully.