DROP SEQUENCE in SQL Server

Read – SEQUENCE in SQL Server
Read – Applying a SEQUENCE to an existing table.
Read – Find the last used SEQUENCE value
Read – Modifying the SEQUENCE

We can delete or remove any user-created SQL Server object using the DROP statement.

Syntax:
DROP SEQUENCE [ IF EXISTS ] { database_name.schema_name.sequence_name | schema_name.sequence_name | sequence_name } [ ,…n ]
[ ; ]

Example:
DROP SEQUENCE TestSeq;

Use the IF EXISTS keyword since it will throw an error if there is no such SEQUENCE.

DROP SEQUENCE IF EXISTS TestSeq;

Hope you find this article helpful.

One comment

Leave a Reply