meta data for this page
  •  

ALTER SEQUENCE

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.