Back to Snowflake in Google Sheets
SheetXAI logo
Snowflake logo
Snowflake · Google Sheets Guide

Run a Data Quality Audit Across Snowflake Tables Into a Google Sheet

2026-05-14
5 min read

The Scenario

A stakeholder email arrived Friday morning: the client governance review is next Thursday, and they want a data quality report covering your 15 core Snowflake tables. Null rates on primary keys. Duplicate counts. Total row counts. One clean sheet, one row per table, ready to share.

You've done data quality checks before. You know what they involve: writing a bespoke COUNT(*) and a COUNT(DISTINCT pk) and a SUM(CASE WHEN pk IS NULL THEN 1 ELSE 0 END) for each table, running each query separately, copying each result into the sheet, aligning the columns, double-checking that the table names match between the query results and the sheet rows.

For 15 tables that's 15 separate queries, 15 copy-paste cycles, and at least one mistake you'll catch only after you've shared the sheet.

The bad version:

  • Write a null-check query for CUSTOMERS, run it in SnowSight, note the count on a sticky note
  • Write the same query for ORDERS, run it, note the count, slowly realize you forgot to check duplicates
  • Start over with a more complete query template — and discover that INVOICES uses a composite primary key and your template assumed a single column called ID

The governance doc is due in six days. Three of those days you're supposed to be doing something else.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It reads the sheet, connects to Snowflake through its built-in integration, and can run validation queries across multiple tables in sequence — writing one structured result row per table into the sheet.

Open a blank Google Sheet and paste this into the SheetXAI sidebar:

For each of these 10 Snowflake tables in DB PROD schema PUBLIC: CUSTOMERS, ORDERS, PRODUCTS, INVOICES, RETURNS, EVENTS, SESSIONS, LEADS, OPPORTUNITIES, ACCOUNTS — run a query to count total rows, count null primary key values, and count duplicate primary key values, then write one result row per table in this sheet with columns: table_name, total_rows, null_pks, duplicate_pks

What You Get

  • One row per table: table_name, total_rows, null_pks, duplicate_pks
  • Each metric computed in Snowflake — no estimation, no sampling
  • Tables written in the order you listed them, labeled correctly
  • If a table is inaccessible or has a non-standard schema, SheetXAI flags it in the row rather than skipping it

What If the Data Is Not Quite Ready

Some tables use composite primary keys instead of a single ID column

For Snowflake tables in DB PROD schema PUBLIC: ORDERS (pk: order_id), INVOICES (pk: invoice_id + line_item_id composite), RETURNS (pk: return_id) — for each table count total rows, count rows where any pk column is null, and count duplicate pk combinations, write one row per table with columns: table_name, total_rows, null_pks, duplicate_pks

You need null rates by column, not just for primary keys

Query Snowflake schema ANALYTICS.DW and find all columns with a null rate above 15% — write database, schema, table_name, column_name, null_count, total_rows, and null_pct into this Google Sheet sorted by null_pct descending

Add a row-count trend by comparing current count to a reference snapshot

For Snowflake tables CUSTOMERS, ORDERS, PRODUCTS in DB PROD schema PUBLIC — count total rows in each table, then compare to these expected minimums: CUSTOMERS 50000, ORDERS 200000, PRODUCTS 5000 — write table_name, total_rows, expected_minimum, and a column called status that says OK if count >= expected and BELOW if not

Full audit: null rates, duplicates, row counts, and a summary row

For these 10 Snowflake tables in PROD.PUBLIC: CUSTOMERS, ORDERS, PRODUCTS, INVOICES, RETURNS, EVENTS, SESSIONS, LEADS, OPPORTUNITIES, ACCOUNTS — count total rows, null primary keys, duplicate primary keys, and calculate null_pk_rate as null_pks/total_rows — write one row per table into this sheet, then add a summary row showing totals and the table with the highest null_pk_rate

The pattern: running the analytics and writing the report are the same instruction — you don't make twelve round trips to SnowSight to build one table.

Try It

Get the 7-day free trial of SheetXAI and open a blank Google Sheet, then ask it to run null checks, duplicate counts, and row counts across your Snowflake tables in one pass. Also see run a SQL query into a sheet for ad-hoc analytics queries, or return to the Snowflake integration overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more