Create a named stage, upload a file and find it
Create the empty location, upload the local file, then list the file entries.
Understand the idea
Use the same sandbox database and schema where you created orders_csv_v1 in lesson 3. The example assumes that format already exists. Save the exact CSV shown above as orders.csv in a local folder. The path /tmp/learnsnowflake/orders.csv below is an example; replace it with the absolute path on the computer running your client.
| Concept | What it means |
|---|---|
| CREATE STAGE | Defines the location. |
| PUT | Transfers a local file through a supported client. |
| LIST | Shows staged file entries. |
A concrete example
An analyst successfully creates orders_stage but sees an empty LIST result. That is expected until the file is uploaded. Creating the receiving location and delivering the file are separate steps.
Remember: CREATE STAGE creates the location, PUT transfers a local file and LIST inspects file entries. None of these operations loads table rows.
Explain it step by step · full theory
Set up the workspace before copying commands
Use the same sandbox database and schema where you created orders_csv_v1 in lesson 3. The example assumes that format already exists. Save the exact CSV shown above as orders.csv in a local folder. The path /tmp/learnsnowflake/orders.csv below is an example; replace it with the absolute path on the computer running your client.
For a fresh named internal stage, your role needs USAGE on the parent database and schema and CREATE STAGE on the schema. It also needs access to the file format. A role using an existing internal stage needs the appropriate stage privileges: READ for reading/listing and WRITE for upload; READ must be granted before or with WRITE. Ask the owner to grant access to the intended role if necessary.
Create an empty location with a default format
CREATE STAGE orders_stage without an external URL creates a named internal stage. Its FILE_FORMAT setting refers to the previously created orders_csv_v1 object. This gives operations a default interpretation for these files.
The statement does not search your laptop or upload orders.csv. Immediately after creation, a new stage has no uploaded order files. It also does not create a destination table.
Upload from a client that can read your local file
PUT is a client-side file transfer command for internal stages. Use a supported client such as Snowflake CLI or SnowSQL, connected to the intended account and context. Do not expect a Snowsight SQL worksheet to read a path on your laptop. Snowsight also offers a separate file-upload interface for named internal stages.
The source file:// URI refers to the client machine. The destination @orders_stage/incoming/ refers to a prefix inside the stage. AUTO_COMPRESS = FALSE keeps this tiny learning file uncompressed so that its staged name stays orders.csv. Compression is useful in real workflows, but we keep the first example easy to trace.
Confirm the file location without claiming row success
LIST @orders_stage/incoming/ returns file metadata such as name and size. Expect an entry ending in incoming/orders.csv after a successful upload. The full returned name can depend on the stage; it is not shown here as a fabricated exact result.
LIST does not show the four parsed orders. If it is empty, check the connection, current database and schema, upload destination and prefix. If it reports an authorization error, check the active role and grants. The next lesson reads the file contents.
Words used in this lesson
- PUT
- Uploads local files to an internal stage through a supported client.
- LIST
- Displays entries and metadata for staged files.
- Default format
- A format associated with a stage for use when an operation does not override it.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
Create a named stage, upload a file and find it
Prepare
Select the sandbox context and create the format first.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- Prepare
Select the sandbox context and create the format first.
- Create
Make an empty named internal stage.
- Transfer
The supported local client reads and uploads the file.
- Inspect
Confirm the file entry exists before trying to parse its contents.
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Shared orders.csv and internal-stage setup
Four orders, one CSV contract
Every CSV lesson uses this fictional orders.csv. One data record represents one order. The first line is a header; the four remaining lines are data. All amounts use the same fictional currency.
order_id,customer_name,amount,order_date
101,"Asha, Rao",120.50,2025-01-01
102,Ben,,2025-01-02
103,Cara,NULL,2025-01-03
104,Dev,0,2025-01-04Notice the comma inside Asha’s quoted name, Ben’s empty amount, Cara’s literal NULL marker and Dev’s zero. We will follow these exact values from file bytes to parsed fields.
Setup order for optional manual practice
- Select an authorized sandbox database and schema. Keep this context consistent across your client sessions.
- Create orders_csv_v1 using lesson 3, then orders_stage using lesson 5. Use fresh sandbox names; do not replace existing shared objects.
- Save the text above as a UTF-8 file named orders.csv. Upload it with a supported local client or the named-stage upload interface.
- Keep only this sample file under the incoming/ prefix when following the four-row expected results.
- Select an authorized warehouse for the staged SELECT examples. File previews use compute; this website runs no SQL.
The examples assume the required role privileges described in the lessons. The external-stage and JSON examples have their own additional setup and are clearly marked.
Before running this lesson
Internal-stage learning path. Use L2_OBJECTS_LAB.SALES from Module 03, with an authorized role and warehouse. Create orders_csv_v1 in lesson 3, then orders_stage in lesson 5. Save the exact sample as UTF-8 orders.csv. Keep only this file in incoming/ for the illustrated four-row results. Use fresh names if a setup object already exists.
Create the named internal stage
-- Run after creating orders_csv_v1 in this same schema.
CREATE STAGE orders_stage
FILE_FORMAT = (FORMAT_NAME = 'orders_csv_v1');What to expect and why
No URL means this is internal. The format is a stored reference, not an upload instruction. Use a fresh sandbox name; these examples intentionally avoid CREATE OR REPLACE.
Upload using a supported local client
-- Client command: replace this with your actual local file path.
PUT file:///tmp/learnsnowflake/orders.csv
@orders_stage/incoming/
AUTO_COMPRESS = FALSE;What to expect and why
The local file must already exist. This transfers bytes to the internal stage. It does not parse those bytes into an ORDERS table.
Inspect the uploaded file entries
LIST @orders_stage/incoming/;What to expect and why
Look for incoming/orders.csv. File presence is the success criterion for this step; parsed records and their values are checked separately.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
PUT reports success but LIST @orders_stage/other/ is empty. What should you inspect first?
Compare your reasoning
Compare the upload destination with the LIST prefix. Our upload used incoming/, not other/. Then confirm both commands refer to the same account, database, schema and stage.
Official sources and curriculum
Module 05 · See module scope