We usually wanted to verify the last sequence value produced by the sequences when using them, as well as the sequence’s features, such as its created date, changed date, cached, whether it is cycling, minimum value, maximum value, current value, last used value, etc.
SELECT * FROM sys.sequences WHERE name = ‘EmpSeq’;
SELECT cache_size, current_value, last_used_value FROM sys.sequences
WHERE name = ‘EmpSeq’ ;
last_used_value is the column that has the last value generated by the Next Value For function.
Please click here for more information about sequences.
For a sample of applying a sequence on a table, click here.
3 comments