# Load data into Snowflake using a SQL statement

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-12-06
- **Format:** Video · 6 min watch · transcript available
- **Topics:** Data engineering, Data prep
- **Tools:** Snowflake (databases, tables, warehouses); SQL (select); Tableau
- **Canonical:** https://just-tim.com/posts/load-data-into-snowflake-using-a-sql-statement
- **Watch:** https://www.youtube.com/watch?v=cMMIt6tbuaM

I walk through loading sample data into Snowflake from a SQL statement, which I needed as setup for demoing row level security in Tableau 21.4. Using the Snowflake web interface I create a database, run the table-creation SQL, insert the data, and preview the results.

## Key takeaways

- Snowflake database names can't contain spaces, so use underscores when creating one through the interface
- If you don't own the database you need to set up the relevant role privileges before creating tables and inserting data
- In the Snowflake worksheets you must specify the target database and schema in the top-right context before running SQL, or it will error
- Highlighting just the SQL you want and clicking run is a safer habit than executing an entire script at once
- You can preview loaded rows either via the preview data button or by right-clicking the table in the object explorer

## Chapters

- 0:00 Why I'm loading data into Snowflake
- 0:59 Creating the demo database
- 2:25 Running the table-creation SQL
- 4:14 Inserting and previewing the data

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/load-data-into-snowflake-using-a-sql-statement

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
