>>> Matt Goodall wrote > > When adding to a database table I need to calculate the next number from > > the existing records, increment that number and add the new record using > > the calculated number. What database are you using? Does it support sequences? identity columns? that's what they're for :)