- Schema:
TAG_REFERENCES view¶
This Account Usage view can be used to identify the associations between objects and tags.
This view only records the direct relationship between the object and the tag. Tag inheritance is not included in this view.
The view is complementary to the information schema table function TAG_REFERENCES.
Columns¶
Column Name |
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_ID |
NUMBER |
Internal/system-generated identifier for the tag. Note that for system tags this value is NULL. |
TAG_NAME |
TEXT |
The name of the tag. This is the |
TAG_VALUE |
TEXT |
The value of tag. This is the |
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_ID |
NUMBER |
Internal identifier of the referenced object. |
OBJECT_NAME |
TEXT |
Name of the referenced object if the tag association is on the object. If the tag association is on a column, Snowflake returns the parent table name. |
OBJECT_DELETED |
TIMESTAMP_LTZ |
Date and time when the associated or parent object was dropped. |
DOMAIN |
TEXT |
Domain of the reference object (e.g. table, view) if the tag association is on the object. For columns, the domain is COLUMN if the tag association is on a column. For more information, see supported domains. |
COLUMN_ID |
NUMBER |
The local identifier of the reference column; not applicable if the tag association is not a column. |
COLUMN_NAME |
TEXT |
Name of the referenced column; not applicable if the tag association is not a column. |
APPLY_METHOD |
TEXT |
Specifies how the tag got assigned to the object.
|
Usage notes¶
Latency for the view may be up to 120 minutes (2 hours).
The view only displays objects for which the current role for the session has been granted access privileges.
The view does not contain information about columns that have been deleted.
The TAG_DATABASE_ID column is not included in this view. To obtain this value in your query result, perform a JOIN operation with the TAGS view.
Examples¶
Return the tag references for your Snowflake account:
select tag_name, tag_value, domain, object_id from snowflake.account_usage.tag_references order by tag_name, domain, object_id;
Return the active objects that have tag associations in your Snowflake account. The addition of the specified WHERE clause filters the objects that are deleted:
select tag_name, tag_value, domain, object_id from snowflake.account_usage.tag_references where object_deleted is null order by tag_name, domain, object_id;