Skip to main content

DROP TAG

Introduced or updated: v1.2.863

Removes a tag. A tag cannot be dropped if it is still referenced by any object — you must first unset the tag from all objects or drop those objects.

See also: CREATE TAG, SET TAG / UNSET TAG

Syntax

DROP TAG [ IF EXISTS ] <tag_name>

Examples

-- Fails if the tag is still in use
DROP TAG env;
-- Error: Tag 'env' still has references

-- Remove the tag reference first
ALTER TABLE my_table UNSET TAG env;

-- Now it succeeds
DROP TAG env;

Drop a tag only if it exists:

DROP TAG IF EXISTS env;
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today