# How do I export a Snowflake query result to a stage and retrieve the files?

Exam: COF-C03 — SnowPro Core Certification Exam
Knowledge domain: Data Loading, Unloading, and Connectivity
Updated: 2026-11-25T08:00:25.90351+00:00
HTML: https://learningpathx.com/faq/COF-C03/cofc03-unload-query-results-to-a-stage.html

## Also asked as

- How do I use COPY INTO location to deliver a Snowflake query result?
- What are the Snowflake commands and permissions for an outbound staged export?

Run `COPY INTO <location>` with the destination stage and a table or SELECT query as the source. Then retrieve the output with `GET` from an internal stage using a supported client, or with the cloud provider's tools and credentials from an external stage. Verify the written files and reconcile them against the source result before handing them off.

```sql
COPY INTO @analytics.exports.daily_orders/run_20261125_01/
FROM (
  SELECT order_id, customer_id, order_total
  FROM analytics.curated.orders
  WHERE order_date = DATE '2026-11-24'
)
FILE_FORMAT = (FORMAT_NAME = 'analytics.exports.parquet_export')
OVERWRITE = FALSE;
```

The example assumes a pre-created stage and named Parquet format, compatible columns, and a populated table. Use a fixed business date or another stable cutoff for a repeatable export. A query can filter, join, or project columns before writing. Parallel or partitioned output should be consumed as a file set. Apply a required total order explicitly in the receiving system.

Check `SELECT` on source objects, container and warehouse access, `USAGE` on the named format, and destination privileges. For a named internal stage, grant `READ` before or together with `WRITE`. The unload uses `WRITE` and retrieval uses `READ`. For a named external stage using a storage integration, check `USAGE` on the stage and the cloud identity's permissions for the destination path. The executing role also needs `USAGE` on the storage integration unless the stage-owning role has that privilege. A scoped storage integration is the preferred pattern for a private external destination.

Use COPY's result, `LIST` or cloud inventory, and downstream row counts or business totals to verify the delivered files.

[Bulk unloading and retrieval](https://docs.snowflake.com/en/user-guide/data-unload-overview) · [COPY INTO location](https://docs.snowflake.com/en/sql-reference/sql/copy-into-location) · [Stage and object privileges](https://docs.snowflake.com/en/user-guide/security-access-control-privileges) · [LIST](https://docs.snowflake.com/en/sql-reference/sql/list) · [Unload to a Snowflake stage](https://docs.snowflake.com/en/user-guide/data-unload-snowflake)

Source: [Unloading Data and Building Reliable Export Workflows](https://learningpathx.com/news/unloading-data-and-building-reliable-export-workflows.html)
