SnowSQL Setup & Connection

Snowflake · Staging & SnowSQL

Theory

SnowSQL is Snowflake's original command-line client for running SQL and file commands from a terminal or script. Snowflake now calls it a legacy client: new features go only into Snowflake CLI (the snow command), which is the recommended client for new work. Both connect with an account identifier of the form orgname-accountname, and both save named connections in a config file, so snowsql -c my_conn or snow sql -c my_conn connects with one short command.

The main reason learners need a client is moving files between their machine and an internal stage: PUT and GET in SnowSQL, or snow stage copy in Snowflake CLI. Existing SnowSQL scripts keep working while their version is supported, but plan new automation on Snowflake CLI.

Why we use it

Some tasks need a client on your machine: uploading local files to a stage, downloading unloaded files, and running SQL scripts from schedulers or CI jobs where there is no browser. Knowing both clients lets you maintain old SnowSQL scripts and write new ones in Snowflake CLI.

When to use it

Use Snowflake CLI for new file uploads, scripted deployments and automation; keep SnowSQL only for existing scripts. Use Snowsight Workspaces for interactive analysis. Use key-pair authentication rather than passwords in scripts.

Snowflake CLI vs SnowSQL

Snowflake CLI (the snow command) is the preferred command-line client and the only one getting new features. SnowSQL is a legacy client that is still supported for existing scripts; check its version's support end date and plan a move to Snowflake CLI.

Connecting to Your Account

Both clients need your account identifier, preferably orgname-accountname. In Snowsight, open the account selector and choose View account details; its Config File tab gives a ready-made connection you can paste.

Saving Connection Details

A config file saves account, user, role, warehouse and database as a named connection so you don't retype them — Snowflake CLI uses config.toml with [connections.<name>] sections. Keep passwords out of it; use key-pair auth or environment variables.

How it works

  1. Install Snowflake CLI (or SnowSQL for legacy scripts)
  2. Copy the account identifier from View account details in Snowsight
  3. Add a named connection (snow connection add)
  4. Test it with snow connection test -c my_conn
  5. Did authentication succeed? Yes: Set role, warehouse, database and schema. No: Check identifier, user, network policy or MFA.
  6. Run SQL and file commands from the terminal

Example

-- Run in a terminal, NOT inside Snowflake.
-- Snowflake CLI (recommended):
--   snow connection add
--   snow connection test -c my_conn
--   snow sql -c my_conn -q "SELECT CURRENT_ACCOUNT();"
-- SnowSQL (legacy):
--   snowsql -a myorg-myaccount -u AYUSHI

Key points

Snowflake topics

Snowflake Fundamentals

Warehouses & Performance

Staging & SnowSQL

Tables & Data Handling

Cloud Integrations

Storage & Optimization

Security & Governance

Views, Pipelines & Automation

Data Types & SQL Fundamentals

Semi-Structured Data Deep Dive

Advanced Features

Data Sharing & Collaboration

Cost Management & Monitoring

Databases, Schemas & Objects

Performance Deep Dive

Advanced Security & Governance

Stored Procedures & UDFs

Ecosystem & Integrations

SnowPro Certification Prep

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Mastering Snowflake

The modern data cloud, from architecture to SnowPro certification. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice Snowflake SQL Sharpen the SQL you use in Snowflake: 150 query problems in a live editor with instant checking. Start practising →
Section {{ sec.num }}

{{ sec.label }}

Snowflake  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

{{ sec.h }}

{{ sec.body }}

{{ sec.body }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
On screen — where to click

{{ rich.ui.title }}

{{ u.text }}
  1. {{ st.n }}{{ st.text }}
{{ rich.ui.title }}
{{ u.text }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax
{{ current.syntax }}
Example
{{ current.example }}
Want to run this yourself? Unlike the SQL and Python courses, Snowflake needs a real account — there's no in-browser engine for it. Click Copy above, then paste it into a free Snowflake trial (30 days, no card required) and run it in Snowsight.
Key Points — click to check off as you learn
  • {{ pt.mark }} {{ pt.text }}

Share this topic