Alters a sequence.
ALTER SEQUENCE [owner.]sequence-name [ RESTART WITH signed-integer ] [ INCREMENT BY signed-integer ] [ MINVALUE signed-integer | NO MINVALUE ] [ MAXVALUE signed-integer | NO MAXVALUE ] [ CACHE integer | NO CACHE ] [ CYCLE | NO CYCLE ]
Restarts the named sequence with the specified value.
Defines the amount the next sequence value is incremented from the last value assigned. The default is 1. Specify a negative value to generate a descending sequence. An error is returned if the INCREMENT BY value is 0.
Defines the smallest value generated by the sequence. The default is 1. An error is returned if MINVALUE is greater than ( 2^63-1) or less than -(2^63-1). An error is also returned if MINVALUE is greater than MAXVALUE.
Defines the largest value generated by the sequence. The default is 2^63-1. An error is returned if MAXVALUE is greater than 2^63-1 or less than -(2^63-1).
Specifies the number of preallocated sequence values that are kept in memory for faster access. When the cache is exhausted, the sequence cache is repopulated and a corresponding entry is written to the transaction log. At checkpoint time, the current value of the cache is forwarded to the ISYSSEQUENCE system table. The default is 100.
Specifies whether values should continue to be generated after the maximum or minimum value is reached.
If the named sequence cannot be located, an error message is returned.
You must be the owner of the sequence, or have one of the following privileges:
None
The ALTER SEQUENCE statement is part of optional ANSI/ISO SQL Language Feature T176. The CACHE clause is not in the standard.
The following example sets a new maximum value for a sequence named Test:
ALTER SEQUENCE Test MAXVALUE 1500;