SELECT CurrTransNo, Stamp Success DO WHILE NOT Success UPDATE ... WHERE Stamp = StampIJustGot IF _TALLY or something like that > 0 Success = .T. ELSE SELECT CurrTransNo, Stamp ENDIF ENDDO>We have a situation where we store a one column, one row entry called CurrTransNo. As the name implies, it stores the next transaction number to be used. This transaction number will be used across many different transaction tables, so it must be unique across all of the tables.
> >DECLARE @nNextTransNo int > >UPDATE NextTransTable SET @nNextTransNo = CurrTransNo + 1, CurrTransNo = CurrTransNo + 1 FROM NextTransTable > >SELECT @nNextTransNo > >GO >>