Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.