Row Zero is the best spreadsheet for big data. Try for free →

How To Connect Google Sheets to Snowflake

2025-03-09 // Nick End, Founder

There are several ways to connect Google Sheets to Snowflake, depending on your needs. This post provides instructions for 3 ways of connecting Google Sheets to Snowflake.

We also show how Row Zero is a better solution for connecting Snowflake to a spreadsheet. Row Zero is an enterprise-grade spreadsheet that can handle much larger datasets and has a built-in Snowflake connector that can connect in a few easy steps.

Table of Contents

3 Ways to Connect Snowflake to Google Sheets:

1. Coefficient

Coefficient is a Google Sheets add-on that makes it easy to connect Google Sheets to Snowflake. Coefficient offers a free plan that limits data import to 5000 rows. The starter plan is $50/mo with the same 5000 row limit and the Pro plan is $99/user/mo and has no row limit on import (but you will still be limited by Google Sheets data limits). To use Coefficient to connect Snowflake to Google Sheets, follow the steps below.

  1. Install the Coefficient extension in Google Sheets. If starting from Coefficient's page, follow the instructions with the pop-up menu. If starting from your own Google Sheets workbook, use the top menu and click Extensions>Add-Ons>Get Add-ons. Search for 'Coefficient.' Select Coefficient from the search results and click 'Individual Install.' get add-ons
  2. Follow the steps to authenticate your Google account with Coefficient and give the add-on access.
  3. Launch the application by going to Extensions > Coefficient > Launch.
  4. Once launched, follow the steps to answer questions and select Snowflake as your import source
  5. Enter your database name, username, password, and an optional nickname. If your Snowflake database is behind a firewall or private network, you will need to whitelist the Coefficient IP addresses. coefficient UI
  6. Once connected, you can use the visual query editor or write your own sql query and click import.
  7. The data will load into a Google sheet. The data in Google Sheets can be automatically updated every time Snowflake data updates if you use a paid tier of Coefficient. Be cognisant of the query result size as Google Sheets has a 10 million cell limit and a file size limit of 100 MB.

In addition to Coefficient, there are several additional Google Sheets add-ins that let you connect to Snowflake. Go to Extensions > Add-Ons > Get Add-ons and search for 'Snowflake' to compare options. Note that all add-ins will still be limited by Google Sheets data size limits and may struggle above 100,000 rows.

If you need to work with larger datasets or want a much less expensive solution, try Row Zero, which is designed for big data and has a built-in Snowflake connector. The free plan lets you connect to Snowflake and paid plans start at $10/month. Read more about using Row Zero as a Coefficient alternative.

2. CSV Upload

The CSV option is simple and free but is not an actual connection between Snowflake and Google Sheets and is a one-time data upload to Google Sheets that will need to be repeated every time the data in Snowflake changes. Follow the steps below for the CSV upload from Snowflake to Google Sheets.

  1. Log in to your Snowflake Account
  2. Create a new worksheet in Snowflake Create Snowflake Worksheet
  3. Write your query. 'Select * from table_name' is an easy way to pull in all data from a particular table. If SQL is a familiar language, write a more complex query to pull the data needed into Google Sheets.
  4. Choose the compute warehouse in the upper right.
  5. Click the blue run button in the upper right-hand corner. Execute Snowflake query
  6. Download results by clicking on the download button and selecting 'download as csv.' Snowflake results download
  7. Upload your Snowflake CSV to Google Sheets. Use an existing account or create a new one. Go to File > Import > Upload. Search for the CSV file on your computer and upload it. If the file isn't too big, Google Sheets will open it and you can begin analyzing your Snowflake data. Upload Snowflake data
  8. Repeat the process if Snowflake data is updated.

Note, Google Sheets has a 100MB CSV import limit and may struggle to work with data above 100,000 rows. If you want to import a larger Snowflake CSV, you can use Row Zero. Row Zero makes it easy to open very large CSV files. The free plan supports 5GB uploads and 10s of millions of rows and Enterprise plans can support billion row spreadsheets.

3. Apps Script

Google Sheets provides an app development functionality within the product, called Apps Script. Apps Script allows Google Sheets users to build custom features within the product, like menus, sidebars, and other web based apps. Apps script also includes a native MYSQL protocol through a Java Database Connectivity (JDBC) service. This JDBC service enables connection to databases. The Apps Script + JDBC functionality can be used to connect Google Sheets to a Snowflake database. To connect Snowflake to Google Sheets using Apps Script, follow the instructions below.

  • Create a new Apps Script in your Google Sheet using the top menu and selecting Extensions > Apps Script Google Sheets Apps Script
  • When the app script window opens, it will look like the image below. Select and delete the sample 'function myfunction()' and begin using the code provided below. Make sure to replace the example values for your own values in the first code snippet below. blank app script window
  • Next, create a set of variables that identify the database address and login information to be used by the program. Replace the values in green with your own values.
//replace the variables in this block with real values as needed
var address = 'my.server.address:port'; // e.g. TF34701.us-west-2.snowflakecomputing.com:443 -> taken from Snowflake URL
var user = 'SQL_GATEWAY_USER'; // e.g. John
var userPwd = 'SQL_GATEWAY_PASSWORD'; // e.g. password12345
var db = 'My_Snowflake_DB'; // e.g. MyCompanyDB
 
var dbUrl = 'jdbc:mysql://' + address + '/' + db; // 
  • Write a function that will appear in the Google Sheets menu bar and allow you to run in from the UI rather than code.
function onOpen() {
var spreadsheet = SpreadsheetApp.getActive();
var menuItems = [
{name: 'Import Snowflake data to a sheet', functionName: 'connectToSnowflakeData'}
];
spreadsheet.addMenu('My Snowflake Data', menuItems);
}
  • Write a function that will identify the first empty row in a spreadsheet in which to start the import.
/*
* Finds the first empty row in a spreadsheet by scanning an array of columns
* @return The row number of the first empty row.
*/
function getFirstEmptyRowByColumnArray(spreadSheet, column) {
var column = spreadSheet.getRange(column + ":" + column);
var values = column.getValues(); // get all data in one call
var ct = 0;
while ( values[ct] && values[ct][0] != "" ) {
ct++;
}
return (ct+1);
}
  • Finally, write a function that will import and write Snowflake data to your Google Sheet.
/*
* Reads data in a specified Snowflake table and then imports it to the specified sheet in your workbook.
*    (If there is no specified Google Sheet, the function will create one.)
*/
function connectToSnowflakeData() {
var thisWorkbook = SpreadsheetApp.getActive();
 
//select a sheet and if it does not exist, create one.
var selectedSheet = Browser.inputBox('Which sheet would you like the data to post to?',Browser.Buttons.OK_CANCEL);
if (selectedSheet == 'cancel')
return;
 
if (thisWorkbook.getSheetByName(selectedSheet) == null)
thisWorkbook.insertSheet(selectedSheet);
var resultSheet = thisWorkbook.getSheetByName(selectedSheet);
var rowNum = 2;
 
//select a Snowflake 'table'
var table = Browser.inputBox('Which table would you like to pull data from?',Browser.Buttons.OK_CANCEL);
if (table == 'cancel')
return;
 
var conn = Jdbc.getConnection(dbUrl, user, userPwd);
 
//confirm that var table is a valid table/view
var dbMetaData = conn.getMetaData();
var tableSet = dbMetaData.getTables(null, null, table, null);
var validTable = false;
while (tableSet.next()) {
var tempTable = tableSet.getString(3);
if (table.toUpperCase() == tempTable.toUpperCase()){
table = tempTable;
validTable = true;
break;
}
}
tableSet.close();
if (!validTable) {
Browser.msgBox("Invalid table name: " + table, Browser.Buttons.OK);
return;
}
 
var stmt = conn.createStatement();
 
var results = stmt.executeQuery('SELECT * FROM ' + table);
var rsmd = results.getMetaData();
var numCols = rsmd.getColumnCount();
 
//if the sheet is empty, populate the first row with the headers
var firstEmptyRow = getFirstEmptyRowByColumnArray(resultSheet, "A");
if (firstEmptyRow == 1) {
//collect column names
var headers = new Array(new Array(numCols));
for (var col = 0; col < numCols; col++){
headers[0][col] = rsmd.getColumnName(col+1);
}
resultSheet.getRange(1, 1, headers.length, headers[0].length).setValues(headers);
} else {
rowNum = firstEmptyRow;
}
 
//write rows of Snowflake data to the sheet
var values = new Array(new Array(numCols));
while (results.next()) {
for (var col = 0; col < numCols; col++) {
values[0][col] = results.getString(col + 1);
}
resultSheet.getRange(rowNum, 1, 1, numCols).setValues(values);
rowNum++;
}
 
results.close();
stmt.close();
}

*The entire script can be found at the end of this blog post in the Appendix

  • Once all the code has been written or copied from this blog, save the project with the 'Save' icon on the top menu bar. Then run the program. You will be prompted to verify and give access to your Google Account. Save and Run Snowflake Import Extension
  • After running the program, you will see a 'Snowflake Data' menu option in your Google Sheet Snowflake Data Menu
  • When running the extension, you will first be asked which sheet should receive the imported data. Simply type the sheet name (e.g. 'Sheet9'). If no sheet with that name exists, a new sheet will be created. select sheet
  • A second question will ask which table should be imported. select table
  • After responding to the questions, the program will import your Snowflake data into the Google Sheet you selected. The script can be re-run every time new data needs to be imported from Snowflake. Snowflake import complete

Why Row Zero is a better solution

Row Zero is an enterprise-grade spreadsheet designed for big data with a built-in Snowflake connector. Row Zero works like Google Sheets and Excel but can handle significantly larger datasets and is much faster than Google Sheets with big data. Row Zero's native Snowflake connection makes it much easier to import data from Snowflake into a spreadsheet and also lets you write back to Snowflake as well. To get started, watch the video below or follow the simple instructions to connect Snowflake to Row Zero.

Connect Snowflake to Row Zero

Here's how to connect Snowflake to spreadsheets in Row Zero:

1. Connect Row Zero to Snowflake

In Row Zero click on the 'Data' icon in the top right of the workbook and then click the button for 'Add connection'. connect spreadsheet to data source

Create new Snowflake connection

Once all the information is entered, hit 'Test connection' to ensure the information is correct.

2. Write a query to import Snowflake data

Now that Snowflake is connected to Row Zero, write a query to pull real-time Snowflake data into the spreadsheet. First select the 'Database' and 'Schema' from the two drop downs. Write a query in the query editor and click Run. The Snowflake data imports to your spreadsheet as a connected table which maintains a live connection to Snowflake. You can re-run the query to get new data or schedule auto-refresh. query snowflake from spreadsheet

3. Build out your Snowflake connected spreadsheet

Row Zero works like Google Sheets and Excel and everything you build on top of connected data stays in sync and automatically updates, so you can build dynamic dashboards, pivot tables, charts, etc. on top of your Snowflake data. If you re-run the query or schedule auto-refresh, everything stays in sync and updates with the new data from Snowflake. automate snowflake import to spreadsheet Here's more info on how to build connected spreadsheets.

Pros and cons of connecting Snowflake to Google Sheets

Pros

Connecting Google Sheets to Snowflake offers several advantages:

  • Live Dashboards and Analysis: With a live connection between Snowflake and Google Sheets, you can build dynamic dashboards, charts, and models that automatically update as new data is added to Snowflake.
  • Snowflake Data Visualization: Easily visualize Snowflake data in Google Sheets with charts, pivot tables, etc.
  • Familiar Interface: Google Sheets provides a familiar spreadsheet interface for analyzing Snowflake data. Connecting Google Sheets to Snowflake allows business and operations teams to leverage governed, data warehouse data without the need for extensive training in complex BI tools.

By connecting Google Sheets to Snowflake you can make big data more accessible to a broader swath of the organization and enable efficient, real-time data analysis.

Cons

While there are several advantages, there are also some drawbacks and limitations of connecting Snowflake to Google Sheets including data and performance limitations, security risks, costs, and overall complexity.

  • Data and performance limits: Google Sheets isn't designed to work with large datasets so will not be able to import large Snowflake tables. Google Sheets has a 10 million cell limit and a file size limit of 100 MB. In practice, Google Sheets can slow down or crash above 100,000 rows, especially as you add formatting, formulas, pivot tables, etc.

  • Security risks: Connecting Google Sheets to enterprise data in Snowflake, especially customer data, can pose a data security risk if appropriate controls and restrictions are not put in place. Google Sheets workbooks are very easy to share, copy, and download, which can lead to data leakage if not managed correctly. If data security is a priority for your organization, consider using Row Zero to connect to Snowflake. Row Zero is specifically designed for enterprise security and gives organizations advanced access controls and the option to restrict sharing, export, and copy/paste. Row Zero can inherit row level security from Snowflake, so it's easy to set up and maintain a secure environment. Learn more about these enterprise security features here.

  • Complexity: Connecting Google Sheets to Snowflake using Google Apps Script takes a lot of steps and can be a challenge for non-technical folks. Some Google Sheets add-ins make the process easier, but also add another layer of cost and data governance considerations. If you need an easy way to connect Snowflake to a secure spreadsheet, try Row Zero, which has a built-in Snowflake connector and has the power to handle large Snowflake datasets.

  • Cost: While Google Sheets add-ins offer an easier way to connect to Snowflake, they can be expensive. For example, Coefficient costs $99 per user per month if you want to import more than 5,000 rows.

Conclusion

There are several options for connecting Google Sheets to Snowflake, depending on your needs. For one-off tasks, CSV upload is probably the easiest. For recurring reports and data workflows, you'll want to set up a true Snowflake connection with ODBC drivers or a Google Sheets add-in. If you need a more powerful and cost-effective solution for big data, consider using Row Zero. Row Zero is a powerful Google Sheets alternative that easily handles massive datasets well beyond Google Sheets limits. It's also significantly less expensive than Coefficient and other Snowflake connectors.

Try Row Zero for free

If you use another cloud data warehouse or blob storage, Row Zero also connects to Snowflake, Databricks, Redshift, BigQuery, and S3.

Appendix

Entire App Script for connecting Snowflake to Google Sheets

//replace the variables in this block with real values as needed
var address = 'my.server.address:port'; // e.g. TF34701.us-west-2.snowflakecomputing.com:443 -> taken from Snowflake URL
var user = 'SQL_GATEWAY_USER'; // e.g. John
var userPwd = 'SQL_GATEWAY_PASSWORD'; // e.g. password12345
var db = 'My_Snowflake_DB'; // e.g. MyCompanyDB
 
var dbUrl = 'jdbc:mysql://' + address + '/' + db;

function onOpen() {
var spreadsheet = SpreadsheetApp.getActive();
var menuItems = [
{name: 'Import Snowflake data to a sheet', functionName: 'connectToSnowflakeData'}
];
spreadsheet.addMenu('My Snowflake Data', menuItems);
}

/*
* Finds the first empty row in a spreadsheet by scanning an array of columns
* @return The row number of the first empty row.
*/
function getFirstEmptyRowByColumnArray(spreadSheet, column) {
var column = spreadSheet.getRange(column + ":" + column);
var values = column.getValues(); // get all data in one call
var ct = 0;
while ( values[ct] && values[ct][0] != "" ) {
ct++;
}
return (ct+1);
}

/*
* Reads data in a specified Snowflake table and then imports it to the specified sheet in your workbook.
*    (If there is no speciiced Google Sheet, the function will create one.)
*/
function connectToSnowflakeData() {
var thisWorkbook = SpreadsheetApp.getActive();
 
//select a sheet and if it does not exist, create one.
var selectedSheet = Browser.inputBox('Which sheet would you like the data to post to?',Browser.Buttons.OK_CANCEL);
if (selectedSheet == 'cancel')
return;
 
if (thisWorkbook.getSheetByName(selectedSheet) == null)
thisWorkbook.insertSheet(selectedSheet);
var resultSheet = thisWorkbook.getSheetByName(selectedSheet);
var rowNum = 2;
 
//select a Snowflake 'table'
var table = Browser.inputBox('Which table would you like to pull data from?',Browser.Buttons.OK_CANCEL);
if (table == 'cancel')
return;
 
var conn = Jdbc.getConnection(dbUrl, user, userPwd);
 
//confirm that var table is a valid table/view
var dbMetaData = conn.getMetaData();
var tableSet = dbMetaData.getTables(null, null, table, null);
var validTable = false;
while (tableSet.next()) {
var tempTable = tableSet.getString(3);
if (table.toUpperCase() == tempTable.toUpperCase()){
table = tempTable;
validTable = true;
break;
}
}
tableSet.close();
if (!validTable) {
Browser.msgBox("Invalid table name: " + table, Browser.Buttons.OK);
return;
}
 
var stmt = conn.createStatement();
 
var results = stmt.executeQuery('SELECT * FROM ' + table);
var rsmd = results.getMetaData();
var numCols = rsmd.getColumnCount();
 
//if the sheet is empty, populate the first row with the headers
var firstEmptyRow = getFirstEmptyRowByColumnArray(resultSheet, "A");
if (firstEmptyRow == 1) {
//collect column names
var headers = new Array(new Array(numCols));
for (var col = 0; col < numCols; col++){
headers[0][col] = rsmd.getColumnName(col+1);
}
resultSheet.getRange(1, 1, headers.length, headers[0].length).setValues(headers);
} else {
rowNum = firstEmptyRow;
}
 
//write rows of Snowflake data to the sheet
var values = new Array(new Array(numCols));
while (results.next()) {
for (var col = 0; col < numCols; col++) {
values[0][col] = results.getString(col + 1);
}
resultSheet.getRange(rowNum, 1, 1, numCols).setValues(values);
rowNum++;
}
 
results.close();
stmt.close();
}

FAQs