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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s