# Snowflake Tag Sync

You have the option of syncing [Tags](/features/tags.md#filter) created in Select Star back to Snowflake. It will sync status and category tags for both tables and columns. Suggested tags will also be synced.

## Enable Snowflake Tag Sync in Select Star

### 1. Create a custom Tag role in Snowflake

First, you will need to create a custom role and give it access to create and apply tags.

<pre class="language-sql"><code class="lang-sql">-- Create tag_admin role
USE ROLE USERADMIN;
CREATE ROLE tag_admin;
GRANT ROLE tag_admin TO USER &#x3C;select_star_user>;


-- Enable tag creation and assignment
USE ROLE ACCOUNTADMIN;
-- &#x3C;db_name>.&#x3C;schema_name> will be where Select Star 
GRANT CREATE TAG ON SCHEMA &#x3C;db_name>.&#x3C;schema_name> TO ROLE tag_admin;
GRANT APPLY TAG ON ACCOUNT TO ROLE tag_admin;

-- Grant usage
GRANT USAGE ON DATABASE &#x3C;db_name> TO ROLE tag_admin;
<strong>GRANT USAGE ON SCHEMA &#x3C;db_name>.&#x3C;schema_name> TO ROLE tag_admin;
</strong></code></pre>

You can find more detailed instructions in Snowflake's documentation [here](https://docs.snowflake.com/en/user-guide/object-tagging.html#step-1-create-a-custom-role-and-assign-privileges).

### 2. Authorize Tag Sync in Select Star

To enable Snowflake Tag Sync in Select Star

1. Go to **Settings**.
2. Choose the **Snowflake data source** in the sidebar.
3. Click the **Snowflake Tag Sync** tab.

![](/files/pU5Zv6HDPJdgauaeGV0d)

4. Click the **Enable Tag Sync** button.

![Snowflake Tag Sync tab in Select Star Settings.](/files/WMnkQ3qSHpGkLSOAy3Bc)

5. Enter the **Role name** of the role you created in [step 1](#1.-create-a-custom-tag-role-in-snowflake) of this guide (`tag_admin` in our example).
6. Enter the **Database Name** and **Schema Name** where Select Star should create Snowflake Tags.
7. Click **Connect**.

<figure><img src="/files/rcqMcvrtujF8m7VXrgR1" alt="" width="375"><figcaption></figcaption></figure>

Select Star will be able to use this role with the credentials you added when you connected Snowflake as outlined in our [Snowflake Setup Guide](/integrations/snowflake.md).

You will first see a message indicating that the Sync is in progress. Once the sync is done, we'll indicate that the tags were synced successfully.

![](/files/CFBapbrnq0LjdJfWMjLO) ![](/files/z8nrPnmi4jUHc4yOqsrN)

{% hint style="info" %}
Please note: It can take a few hours for tags to update in Snowflake's `tag_references` view.
{% endhint %}

{% hint style="danger" %}
You can disable tags at any time by clicking the Disable Tags Sync button.

Disabling tags will delete all tags created by Select Star from your Snowflake instance.
{% endhint %}

## Select Star tags in Snowflake

When Snowflake Tag Sync is enabled, any Tags created in Select Star will be visible in Snowflake.

Select Star tags will have `SELECT_STAR_CATEGORY` (for Category) or `SELECT_STAR_STATUS` (for Status) prepended in the `TAG_NAME` field. The value of the tag is left empty.

![](/files/bvXcaTkSocj6OkoOC38e) ![](/files/TDEi45lNFuqAr2zLatJW)

**Example**: If you had a Sales Tag in Select Star created as a Category tag. The Snowflake tag created would be called `SELECT_STAR_CATEGORY_SALES`.

{% hint style="info" %}
Note: Currently, you can only sync tags from Select Star to Snowflake, and not the other way around. This is to prevent the tools from overwriting each other.
{% endhint %}

{% hint style="danger" %}
Tag names in Select Star must follow Snowflake's [identifier requirements](https://docs.snowflake.com/en/sql-reference/identifiers-syntax) in order to be synced to Snowflake. Spaces in tag names will be automatically replaced with an underscore.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.selectstar.com/integrations/snowflake/snowflake-tag-sync.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
