Back to hub
FAQ

Snowflake Sequence FAQ

Additional frequently asked questions about Snowflake SEQUENCE objects beyond the main guide page.

What permissions are needed to use a sequence?

To call NEXTVAL, you need USAGE privilege on the sequence. To create or alter a sequence, you need CREATE SEQUENCE or ownership on the schema. Sequences inherit schema-level grants like other schema objects.

How does sequence caching work in Snowflake?

Snowflake caches sequence values by default (cache size 20). This improves performance for high-frequency NEXTVAL calls. Cached values are lost on server restart, creating larger gaps. Set NO CACHE for gap-minimized sequences at the cost of performance.

Can I reset a sequence to a specific value?

Use ALTER SEQUENCE seq_name SET VALUE = n to reset. The next NEXTVAL call returns n + increment. Alternatively, CREATE OR REPLACE the sequence with a new START value to fully reset it.

Are sequences transaction-safe?

NEXTVAL calls are not transactional. Once a value is consumed, it is never reissued, even if the transaction rolls back. This guarantees uniqueness at the cost of potential gaps.

Related Pages