SHOW CREATE SEQUENCE

View the SQL used to create a sequence. This statement displays the CREATE SEQUENCE statement with current parameter values.

Syntax

SHOW CREATE SEQUENCE sequence_name;

Description

Shows the CREATE SEQUENCE statement that creates the given sequence. The statement requires the SELECT privilege for the table.

SHOW CREATE SEQUENCE quotes identifiers according to the value of the sql_quote_show_create system variable.

Example

CREATE SEQUENCE s1 START WITH 50;
SHOW CREATE SEQUENCE s1\G;
*************************** 1. row ***************************
       Table: s1
Create Table: CREATE SEQUENCE `s1` start with 50 minvalue 1 maxvalue 9223372036854775806 
  increment by 1 cache 1000 nocycle ENGINE=InnoDB

Notes

If you want to see the underlying table structure used for the SEQUENCE you can use SHOW CREATE TABLE on the SEQUENCE. You can also use SELECT to read the current recorded state of the SEQUENCE:

The Information Schema SEQUENCES Table also provides information about available sequences:

See Also

This page is licensed: CC BY-SA / Gnu FDL

Last updated

Was this helpful?