Subject | Re: [firebird-support] reset autoincrement field |
---|---|
Author | Helen Borrie |
Post date | 2016-12-03T18:53:06Z |
Nico Speleers wrote:
the release notes in PDF form. IDENTITY is documented on page 69
(page 79 by the PDF numbering), including the syntax for making the
(otherwise inaccessible) generator restart with a different value.
Syntax works ONLY with an IDENTITY column.
To re-initialise to zero:
alter table aTable
alter column aTable_ID RESTART
The next number generated will be 1.
To re-intialise to some other number:
alter table aTable
alter column aTable_id RESTART WITH n
The next number generated will be (n+1).
Remember to COMMIT if you are not using isql with autoddl on.
HB
> How can I reset an autoincrement field in firebird 3 ? I usedIn your Fb 3 installation is the /doc/ directory, where you will find
> identity to make an autoincrement field.
the release notes in PDF form. IDENTITY is documented on page 69
(page 79 by the PDF numbering), including the syntax for making the
(otherwise inaccessible) generator restart with a different value.
Syntax works ONLY with an IDENTITY column.
To re-initialise to zero:
alter table aTable
alter column aTable_ID RESTART
The next number generated will be 1.
To re-intialise to some other number:
alter table aTable
alter column aTable_id RESTART WITH n
The next number generated will be (n+1).
Remember to COMMIT if you are not using isql with autoddl on.
HB