TAG_REFERENCES
functionsupportedGovernance (policies, tags, data quality)Returns a table in which each row displays an association between a tag and value. The associated tag and value are the result of a direct association to an object or through tag inheritance.
Syntax
TAG_REFERENCES( '<object_name>' , '<object_domain>' )
Parameters
| Name | Required | Description |
|---|---|---|
'object_name' | required | Name of the referenced object if the tag association is on the object. To identify a logical table, dimension, fact, or metric in a semantic view: Use an exclamation mark (!) between the name of the semantic view and the name of the logical table. Use a period (.) between the name of the logical table and the name of the dimension, fact, or metric. For a derived metric, use a period (.) between the name of the semantic view and the name of the derived metric. For example: 'my_semantic_view!my_logical_table' 'my_semantic_view!my_logical_table.my_dimension' 'my_semantic_view!my_logical_table.my_fact' 'my_semantic_view!my_logical_table.my_metric' 'my_semantic_view.my_derived_metric' |
'object_domain' | required | Domain of the reference object, such as a table or view, if the tag association is on the object. For columns, the domain is COLUMN if the tag association is on a column. Use one of the following values: 'ACCOUNT' 'ALERT' 'BACKUP POLICY' 'BACKUP SET' 'COLUMN' 'COMPUTE POOL' 'CORTEX AGENT' 'CORTEX SEARCH SERVICE' 'DATABASE' 'DATABASE ROLE' 'FAILOVER GROUP' 'FUNCTION' 'INTEGRATION' 'INSTANCE' 'NETWORK POLICY' 'PROCEDURE' 'REPLICATION GROUP' 'ROLE' 'SCHEMA' 'SECRET' 'SHARE' 'SNAPSHOT POLICY' (deprecated; prefer 'BACKUP POLICY') 'SNAPSHOT SET' (deprecated; prefer 'BACKUP SET') 'SNOWFLAKE INTELLIGENCE' 'STAGE' 'STREAM' 'TABLE': Use this for all table-like objects such as views, materialized views, and external tables. 'TASK' 'USER' 'WAREHOUSE' |
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: Column | Data Type | Description TAG_DATABASE | TEXT | The database in which the tag is set. TAG_SCHEMA | TEXT | The schema in which the tag is set. TAG_NAME | TEXT | The name of the tag. This is the key in the key = 'value' pair of the tag. TAG_VALUE | TEXT | The value of the tag. This is the 'value' in the key = 'value' pair of the tag. APPLY_METHOD | TEXT | 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. LEVEL | TEXT | The object domain on which the tag is set. OBJECT_DATABASE | TEXT | Database name of the referenced object for database and schema objects. If the object is not a database or schema object, the value is empty. OBJECT_SCHEMA | TEXT | Schema name of the referenced object (for schema objects). If the referenced object is not a schema object (e.g. warehouse), this value is empty. OBJECT_NAME | TEXT | Name of the reference object if the tag association is on the object. DOMAIN | TEXT | Domain of the reference object (e.g. table, view) if the tag association is on the object. If the tag association is on a column, the domain is COLUMN. COLUMN_NAME | TEXT | Name of the referenced column; not applicable if the tag association is not a column.