Firebird Documentation IndexFirebird 2.0 Language Ref. UpdateDDL statements → ALTER SEQUENCE
Firebird Home Firebird Home Prev: ALTER PROCEDUREFirebird Documentation IndexUp: DDL statementsNext: ALTER TABLE

ALTER SEQUENCE

Tip

Find a more recent version at Firebird 5.0 Language Reference: SEQUENCE (GENERATOR)

Available in: DSQL

Added in: 2.0

Description: (Re)initializes a sequence or generator to the given value. SEQUENCE is the SQL-compliant term for what InterBase and Firebird have always called a generator. ALTER SEQUENCE ... RESTART WITH is fully equivalent to SET GENERATOR ... TO and is the recommended syntax from Firebird 2.0 onward.

Syntax: 

ALTER SEQUENCE sequence-name RESTART WITH <newval>

<newval>  ::=  A signed 64-bit integer value.

Example: 

alter sequence seqtest restart with 0

Warning

Careless use of ALTER SEQUENCE is a mighty fine way of screwing up your database! Under normal circumstances you should only use it right after CREATE SEQUENCE, to set the initial value.

See also: CREATE SEQUENCE

Prev: ALTER PROCEDUREFirebird Documentation IndexUp: DDL statementsNext: ALTER TABLE
Firebird Documentation IndexFirebird 2.0 Language Ref. UpdateDDL statements → ALTER SEQUENCE