Categories:

Information Schema , Table functions

TAG_REFERENCES_ALL_COLUMNS

Returns a table in which each row displays the tag name and tag value assigned to a specific column.

This function returns every tag set on every column in a given table or view, whether the tag is directly assigned to a column or through tag inheritance.

Syntax

TAG_REFERENCES_ALL_COLUMNS( '<object_name>' , '<object_domain>' )

Arguments

'object_name'

Name of the referenced object if the tag association is on the object.

This argument supports the names for tables and views.

'object_domain'

Domain of the referenced object.

Snowflake supports one domain for this function: TABLE.

Note that the domain TABLE must be used for all objects that contain columns, even if the object name is a view (i.e. view, materialized view).

Usage notes

  • Results are only returned for a role that has access to the specified object.

    To view references for system tags associated with sensitive data classification, use a role with IMPORTED PRIVILEGES on the shared SNOWFLAKE database.

  • When calling an Information Schema table function, the session must have an INFORMATION_SCHEMA schema in use or the function must use the fully-qualified object name. For more details, see Snowflake Information Schema.

Output

The function returns the following columns:

ColumnData TypeDescription
TAG_DATABASETEXTThe database in which the tag is set.
TAG_SCHEMATEXTThe schema in which the tag is set.
TAG_NAMETEXTThe name of the tag. This is the key in the key = 'value' pair of the tag.
TAG_VALUETEXTThe value of the tag. This is the 'value' in the key = 'value' pair of the tag.
APPLY_METHODTEXT

Specifies how the tag got assigned to the object. Possible values include the following:

  • CLASSIFIED: The tag was automatically applied to a column that was classified as containing sensitive data. See label-classify_auto_map_tags.
  • INHERITED: The object inherited the tag from an object higher up in the Snowflake securable object hierarchy. See Tag inheritance.
  • MANUAL: Someone manually set the tag on the object using a CREATE <object> or ALTER <object> command. See label-object_tagging_set.
  • PROPAGATED: The tag was automatically propagated from one object to another. See Automatic tag propagation with user-defined tags.
  • NULL: Legacy record.
  • NONE: Legacy record.
LEVELTEXTThe object domain on which the tag is set.
OBJECT_DATABASETEXTThe database name containing the table or view.
OBJECT_SCHEMATEXTThe schema name containing the table or view.
OBJECT_NAMETEXTThe name of the table or view.
DOMAINTEXTThis value should be COLUMN since this function returns all tags set on all columns in the table or view.
COLUMN_NAMETEXTThe name of the column that the tag is set on.

Examples

Retrieve the list of tags that are assigned to every column in the table my_table:

select *
  from table(my_db.information_schema.tag_references_all_columns('my_table', 'table'));