How to Create a Sequence in Snowflake
Last updated July 25, 2026 · By the SaturnSQL team
Use CREATE SEQUENCE, then read values with seq_name.NEXTVAL, typically as a column DEFAULT. For a simple auto-incrementing key, an IDENTITY (AUTOINCREMENT) column does the same without a separate object.
Create and use a sequence
CREATE SEQUENCE order_id_seq START = 1 INCREMENT = 1;
CREATE TABLE orders (
id INTEGER DEFAULT order_id_seq.NEXTVAL,
customer_id INTEGER,
amount NUMBER(10,2)
);
SELECT order_id_seq.NEXTVAL; -- grab a value directlyIDENTITY / AUTOINCREMENT column
CREATE TABLE customers (
id INTEGER IDENTITY(1,1),
email VARCHAR
);Sequence values are guaranteed unique and increasing but not gap-free: rolled-back statements and concurrent sessions can skip numbers. Do not rely on them being consecutive.
Run this in SaturnSQL
SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.
Try it free