Help Center > > Developer Guide> SQL Reference> SQL Syntax> DROP SEQUENCE

DROP SEQUENCE

Updated at: Mar 13, 2020 GMT+08:00

Function

DROP SEQUENCE deletes a sequence from the current database.

Precautions

Only a sequence owner or a system administrator can delete a sequence.

Syntax

DROP SEQUENCE [ IF EXISTS ] {[schema.]sequence_name} [ , ... ] [ CASCADE | RESTRICT ];

Parameter Description

  • IF EXISTS

    Sends a notice instead of an error if the specified sequence does not exist.

  • name

    Specifies the name of the sequence.

  • CASCADE

    Automatically deletes objects that depend on the sequence to be deleted.

  • RESTRICT

    Refuses to delete the sequence if any objects depend on it. This is the default.

Examples

1
2
3
4
5
-- Create a sequence named serial that starts from 101 and increases in ascending order:
CREATE SEQUENCE serial START 101;

-- Delete the sequence:
DROP SEQUENCE serial;

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel