To find an object in Snowflake based on a specific tag value, you can use the following query:
SELECT *
FROM INFORMATION_SCHEMA.OBJECTS
WHERE OBJECT_TYPE = 'TABLE'
AND OBJECT_ID IN (
SELECT DISTINCT TAG_OBJECT_ID
FROM "SNOWFLAKE"."ACCOUNT_USAGE"."TAGS"
WHERE TAG_NAME = '<tag_name>'
AND TAG_VALUE = '<tag_value>'
);
Replace <tag_name>
and <tag_value>
with the name and value of the tag you want to search for. This query searches for tables with a specific tag value, but you can modify the OBJECT_TYPE
parameter to search for views or other types of objects.
Asked: 2022-06-23 11:00:00 +0000
Seen: 11 times
Last updated: Nov 13 '21