Creates a new tag or replaces an existing tag in the system.
CREATE [ OR REPLACE ] TAG [ IF NOT EXISTS ] <name> [ COMMENT = '<string_literal>' ] CREATE [ OR REPLACE ] TAG [ IF NOT EXISTS ] <name> [ ALLOWED_VALUES '<val_1>' [ , '<val_2>' , [ ... ] ] ]
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.
ALLOWED_VALUES 'val_1' [ , 'val_2' , [ ... ] ]
The maximum number of tag values in this list is 50.
Default: NULL (all string values are allowed, including an empty string value (i.e.
COMMENT = 'string_literal'
Specifies a comment for the tag.
Default: No value
Access Control Requirements¶
Note that operating on any object in a schema also requires the USAGE privilege on the parent database and schema.
For instructions on creating a custom role with a specified set of privileges, see Creating Custom Roles.
For additional details on tag DDL and privileges, see Managing Tags.
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.
Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata Fields in Snowflake.
CREATE OR REPLACE <object> statements are atomic. That is, when an object is replaced, the old object is deleted and the new object is created in a single transaction.
Create a tag with the key
CREATE TAG cost_center COMMENT = 'cost_center tag';