> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-structure/sequences/drop-sequence.md).

# DROP SEQUENCE

## Syntax

```bnf
DROP [TEMPORARY] SEQUENCE [IF EXISTS] [/*COMMENT TO SAVE*/]
    sequence_name [, sequence_name] ...
```

## Description

`DROP SEQUENCE` removes one or more [sequences](/docs/server/reference/sql-structure/sequences.md) created with [CREATE SEQUENCE](/docs/server/reference/sql-structure/sequences/create-sequence.md). 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 [GRANT](/docs/server/reference/sql-statements/account-management-sql-statements/grant.md).

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 [SHOW WARNINGS](/docs/server/reference/sql-statements/administrative-sql-statements/show/show-warnings.md).

`DROP SEQUENCE` requires the [DROP privilege](/docs/server/reference/sql-statements/account-management-sql-statements/grant.md).

## Notes

`DROP SEQUENCE` only removes sequences, not tables. However, [DROP TABLE](/docs/server/server-usage/tables/drop-table.md) can remove both sequences and tables.

## See Also

* [Sequence Overview](/docs/server/reference/sql-structure/sequences/sequence-overview.md)
* [CREATE SEQUENCE](/docs/server/reference/sql-structure/sequences/create-sequence.md)
* [ALTER SEQUENCE](/docs/server/reference/sql-structure/sequences/alter-sequence.md)
* [DROP TABLE](/docs/server/server-usage/tables/drop-table.md)
* [Information Schema SEQUENCES Table](/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-sequences-table.md)

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
