All pages
Powered by GitBook
1 of 1

Loading...

DROP SEQUENCE

Syntax

Description

DROP SEQUENCE removes one or more sequences created with CREATE SEQUENCE. You must have the DROP privilege for each sequence. MariaDB returns an error indicating by name which non-existing tables it was unable to drop, but it also drops all of the tables in the list that do exist.

Important: When a table is dropped, user privileges on the table are not automatically dropped. See .

If another connection is using the sequence, a metadata lock is active, and this statement will wait until the lock is released. This is also true for non-transactional tables.

For each referenced sequence, DROP SEQUENCE drops a temporary sequence with that name, if it exists. If it does not exist, and the TEMPORARY keyword is not used, it drops a non-temporary sequence with the same name, if it exists. The TEMPORARY keyword ensures that a non-temporary sequence will not accidentally be dropped.

Use IF EXISTS to prevent an error from occurring for sequences that do not exist. A NOTE is generated for each non-existent sequence when using IF EXISTS. See .

DROP SEQUENCE requires the .

Notes

DROP SEQUENCE only removes sequences, not tables. However, can remove both sequences and tables.

See Also

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

DROP [TEMPORARY] SEQUENCE [IF EXISTS] [/*COMMENT TO SAVE*/]
    sequence_name [, sequence_name] ...
Information Schema SEQUENCES Table
GRANT
SHOW WARNINGS
DROP privilege
DROP TABLE
Sequence Overview
CREATE SEQUENCE
ALTER SEQUENCE
DROP TABLE