SnowSQL File Operations & Data Staging

Snowflake · Staging & SnowSQL

Theory

Three operations move files. Uploading puts local files into an internal stage, compressed with gzip by default and encrypted: PUT in SnowSQL or a driver, or snow stage copy in Snowflake CLI. Downloading (GET, or snow stage copy in reverse) brings staged files back to your machine. COPY INTO <table> then loads staged files into a table, using a file format that describes the delimiter, header rows, quoting, null markers and compression.

For example, PUT file:///data/orders.csv @my_stage creates orders.csv.gz in the stage, and COPY INTO orders FROM @my_stage FILE_FORMAT = (FORMAT_NAME = 'csv_fmt') loads it. In Snowsight you can skip the client: Ingestion → Add data uploads and loads smaller files through the browser.

Why we use it

Bulk loading from files is the fastest and cheapest way to get large data into Snowflake. Staging first separates moving the file from parsing it, so a failed load can be fixed and rerun without uploading again.

When to use it

Use PUT and COPY for files on your machine or a server. For files already in cloud storage, skip PUT and use an external stage. For continuous arrival of files, use Snowpipe instead of running COPY by hand.

PUT: Uploading Files

PUT uploads local files to a stage, compressing them by default (gzip) before transfer to save bandwidth and storage.

GET: Downloading Files

GET reverses the process, pulling staged files back down to your local machine — useful for retrieving exported query results.

COPY INTO: Loading the Data

Once files are staged, COPY INTO loads them into a target table using a file format object that defines the delimiter, header row, and character encoding to expect.

How it works

  1. CSV file on your machine
  2. PUT file to @my_stage (gzip and encrypt)
  3. LIST @my_stage to confirm
  4. COPY INTO table using a file format
  5. Were all rows loaded? Yes: Check row counts and REMOVE files. No: Review errors, fix the file or format, rerun COPY.
  6. Data is queryable in the table

Example

-- Run in a terminal, not Snowsight:
-- SnowSQL:     PUT file:///Users/me/data/orders.csv @my_stage AUTO_COMPRESS=TRUE;
--              GET @my_stage/orders.csv.gz file:///Users/me/downloads/;
-- Snowflake CLI: snow stage copy /Users/me/data/orders.csv @my_stage -c my_conn

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