> ## Documentation Index
> Fetch the complete documentation index at: https://docs.summation.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Snowflake

> Connect Summation to a Snowflake account.

Summation queries Snowflake using a username and password, scoped to a warehouse and role you specify.

## What you'll need

Click on `View account details` link from the menu as seen below:

<Frame>
  <img src="https://mintcdn.com/summation-676748f5/qmdTTYCCWnhxNTSX/images/snowsight-gs-account-details.png?fit=max&auto=format&n=qmdTTYCCWnhxNTSX&q=85&s=bec7b6e6ef0b95afd140b8f9753b8029" alt="Snowsight Gs Account Details" width="1222" height="1246" data-path="images/snowsight-gs-account-details.png" />
</Frame>

Switch to the `Config File` tab on the Account Details modal, we need the following fields from the code block displayed there

<Frame>
  <img src="https://mintcdn.com/summation-676748f5/qmdTTYCCWnhxNTSX/images/snowflake.account.jpeg?fit=max&auto=format&n=qmdTTYCCWnhxNTSX&q=85&s=e393f5c6ab1ee9e4c96418b1610c1998" alt="Snowflake Account" width="1494" height="1052" data-path="images/snowflake.account.jpeg" />
</Frame>

* A **Snowflake account identifier**, that would be of the form `<orgname>-<account_name>`
* A **warehouse** Summation can use to run queries.
* A **username and password** that can be used to authenticate

## Form fields

On Summation side, on the Snowflake connection details page, you can enter the fields we noted above into the form:

| Field                  | Required | Stored as | Notes                                                                                                                                                                                                                              |
| ---------------------- | -------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Account Identifier** | Yes      | Config    | e.g. `myorg-myaccount`. Don't include `.snowflakecomputing.com`. See [Finding the organization and account name](https://docs.snowflake.com/en/user-guide/admin-account-identifier#label-account-name-find) in the Snowflake docs. |
| **Warehouse**          | Yes      | Config    | The compute warehouse, e.g. `COMPUTE_WH`. See [Overview of warehouses](https://docs.snowflake.com/en/user-guide/warehouses-overview).                                                                                              |
| **Role**               | Optional | Config    | Snowflake role to assume. Defaults to the user's default role if blank. See [Overview of access control](https://docs.snowflake.com/en/user-guide/security-access-control-overview).                                               |
| **Username**           | Yes      | Config    | Snowflake login name.                                                                                                                                                                                                              |
| **Password**           | Yes      | Secret    |                                                                                                                                                                                                                                    |

## Recommended Best Practice (Optional)

<Tip>
  Create a dedicated `SUMMATION_USER` and `SUMMATION_ROLE` rather than re-using a personal login. Easier to audit, and you can rotate credentials without disrupting humans.
</Tip>

## Setup SQL

Run as `ACCOUNTADMIN` (or another role with sufficient privileges):

```sql theme={null}
CREATE ROLE IF NOT EXISTS SUMMATION_ROLE;

CREATE WAREHOUSE IF NOT EXISTS SUMMATION_WH
  WITH WAREHOUSE_SIZE = 'XSMALL'
       AUTO_SUSPEND   = 60
       AUTO_RESUME    = TRUE;

GRANT USAGE ON WAREHOUSE SUMMATION_WH TO ROLE SUMMATION_ROLE;

-- Grant read access to the data you want exposed
GRANT USAGE  ON DATABASE ANALYTICS                       TO ROLE SUMMATION_ROLE;
GRANT USAGE  ON ALL SCHEMAS IN DATABASE ANALYTICS        TO ROLE SUMMATION_ROLE;
GRANT SELECT ON ALL TABLES  IN DATABASE ANALYTICS        TO ROLE SUMMATION_ROLE;
GRANT SELECT ON FUTURE TABLES IN DATABASE ANALYTICS      TO ROLE SUMMATION_ROLE;

CREATE USER IF NOT EXISTS SUMMATION_USER
  PASSWORD          = '<strong-password>'
  DEFAULT_ROLE      = SUMMATION_ROLE
  DEFAULT_WAREHOUSE = SUMMATION_WH;

GRANT ROLE SUMMATION_ROLE TO USER SUMMATION_USER;
```

For more on grants, see [GRANT \<privileges>](https://docs.snowflake.com/en/sql-reference/sql/grant-privilege) in the Snowflake docs.

## Adding datasets

After saving the connection, browse the tree of databases and schemas in the dataset picker and select tables or views. Each dataset's source reference looks like:

```text theme={null}
snowflake:DATABASE.SCHEMA.TABLE
```

## Common problems

| Error or symptom                          | Likely cause                                                               |
| ----------------------------------------- | -------------------------------------------------------------------------- |
| `Authentication failed`                   | Wrong username or password, or the user is locked or password-expired.     |
| `Object does not exist or not authorized` | The role can't see the schema or table. Re-check the `GRANT` statements.   |
| `Warehouse not found`                     | Warehouse name is case-sensitive in some accounts — match casing exactly.  |
| Login blocked by MFA                      | Summation uses password auth. Use a service user that doesn't require MFA. |
