In message
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:

> Adam <[EMAIL PROTECTED]> wrote:
> > Hi,
> > 
> > I have a table which includes a column "customorder integer primary key
> > autoincrement" which I use to address rows in the table.
> > 
> > When I delete a row, I renumber the remaining rows so that the key
> > remains continuous (to match my GUI display). However, when I
> > subsequently insert a new row, the auto-generated key starts from the
> > old maximum. Is there a way to reset the autoincrement counter so that
> > after deletions and insertions, the counter remains continuous? 
> 
> The purpose of AUTOINCREMENT is to guarantee that you never
> get the same primary key on two rows - even rows that have
> been deleted.  If you don't need that property, (and apparently
> you do not since your question is how to override it) just omit
> the AUTOINCREMENT keyword. SQLite will then assign the next
> available integer to customorder, rather than an integer that
> has never been used before.

Magic, thanks a lot :-)

Adam

-- 
Adam Richardson
Carpe Diem

Reply via email to