Categories:

User & Security DDL

CREATE TAG

Creates a new tag or replaces an existing tag in the system.

Syntax

CREATE [ OR REPLACE ] TAG [ IF NOT EXISTS ] <name>
[ COMMENT = '<string_literal>' ]

Required Parameters

name

Identifier for the tag; must be unique for your schema. The identifier is the key in the key = 'value' pair of the tag. Assign the 'value' using an ALTER <object> statement.

The identifier value must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g. “My object”). Identifiers enclosed in double quotes are also case-sensitive.

For more details, see Identifier Requirements

Optional Parameters

COMMENT = 'string_literal'

Specifies a comment for the tag.

Default: No value

Usage Notes

  • You must specify a database (i.e. use database my_db;) before executing the CREATE TAG statement.

  • Snowflake limits the number of tags in an account to 10,000.

  • For more information on how tags can be associated to Snowflake objects, see Object Tagging.

  • For more information on tag DDL authorization, see required privileges.

Examples

Create a tag with the key cost_center.

create tag cost_center comment = 'cost_center tag';