sys.sequences

compatibility
#compatibility#catalog-view

Description

Contains a row for each sequence object in a database. The starting value for the sequence object. If the sequence object is restarted by using ALTER SEQUENCE it will restart at this value. When the sequence object cycles it proceeds to the The value that is used to increment the sequence object after each The minimum value that can be generated by the sequence object.

Syntax

start_value
-9223372036854775808 increment
1 minimum_value
-9223372036854775808 maximum_value
9223372036854775807 is_cycling
0 is_cached
1 current_value
-9223372036854775808

Examples

Example 1

CountBy1

Example 2

SELECT sch.name +
'.'
+ seq.name
AS
[
Sequence schema and name
]
FROM sys.sequences
AS seq
JOIN sys.schemas
AS sch
ON seq.schema_id = sch.schema_id ;
GO

Example 3

DROP
SEQUENCE
CountBy1 ;
GO