Introduction
In this article, we will learn the uploading process of the CSV and JSON files into a Snowflake stage using a SnowSQL client. Once the file is uploaded into the Stage, then we can perform a bulk copy operation to load the data from the file to a Snowflake table. Before working on the problem statement, we should have knowledge of SnowSQL and Snowflake Stage. SnowSQL is just a connector whereas a Snowflake stage is a location where we are loading our files. We can create an Internal and external stage in Snowflake. The external stage for AWS or Azure or GCP can be created in Snowflake. We should have the required keys respective to the cloud provider. In this case, if we have stored our CSV/JSON/XML or any semi-structured supported files in the S3 bucket or Azure Blob, we can simply stage it, and it will be available in Snowflake for data loading into the table.
That is why sometimes we say this process as ELT instead of ETL. In the ELT (Extraction, Loading, and transformation) process, first, we extract data from any source, then load it into a storage location to stage it on Snowflake. Once we have the list of files in Stage, we can transform those data as per our requirements. We are going to discuss the following things in detail
- SnowSQL
- Snowflake Stage
- Problem statement (uploading file to the stage and loading the data from the stage to the snowflake table)
What Is SnowSQL?
It is a command-line client that is used to connect Snowflake. Instead of Snowflake Web Interface, we can use the SnowSQL tool to perform/execute SQL query, DDL, and DML commands, including loading and unloading data. To install SnowSQL, please download the executable from the following link

Let us set up the SnowSQL in our system to work on our problem statement. Perform the following steps to install and configure.
Step 1. Download the executable from the given link and double-click once it is downloaded (refer to the below screen).

Step 2. Click on Next until you reach the below screen.

If you closely look at the screen, then you can see some instructions. We need to configure the account detail in ~/.snowsql/config file.
Step 3. Click on the Finish button.
To check whether SnowSQL is installed or not. Window key + R or Run command
Step 4. Open the Run command. You will get the below screen:

Step 5. Type %USERPROFILE%\.snowsql\ and then click on OK
Step 6. You can see the below screen. Now open the config file in Notepad or notepad++

Step 7. Add the Snowflake account information based on the below screen.
You need to provide an accountname, region, username, password, dbname, schemaname, warehousename, and rolename. This information you can get in your Snowflake web Interface.

Step 8. You can see [connections.my_example_connection] in the above screen. Here, my_example_connection we use to connect Snowflake in command prompt. You can give any name.
Step 10. Type ‘snowsql -v’, like shown below.

Step 11. Type snowsql -c my_example_connection and press the enter key
This command connects the snowsql with Snowflake as per the given configuration. In this case, it will come as ,nitesh#COMPUTE_WH@TEST_DB.MANAGEMENT refer below screen. Now you perform any SQL query, DML or DDL command.

Now SnowSQL is installed and configured in your system properly. Let us discuss the Snowflake Stage.
Snowflake Stage
It specifies the stored data files location, so we can load the data into the table. You can explore on the Snowflake documentation.
The following types of Stages can be created in Snowflake:
- User stage
- Table Stage
- Internal Named Stage
While uploading a file into the internal stage, we must specify the internal stage name in the PUT command, and while loading data into a table from staged files we must specify the stage name in COPY INTO <table> command
User Stages
By default, each user has a Snowflake stage allocated for storing files. It is a convenient option if your files will only be accessed by a single user but need to be copied into multiple tables.
Characteristics and Limitations
- It is referenced using @~; e.g. use LIST @~ to list the files in a user stage.
- It cannot be altered or dropped.
- It does not support setting file format options. Instead, you must specify the file format and copy options as part of the COPY INTO <table> command.
Table Stages
By default, each table has a Snowflake stage allocated for storing files. It is a convenient option if your files need to be accessible to multiple users and only need to be copied into a single table.
Characteristics and Limitations
- It has the same name as the table, e.g. a table named mytable has a stage referenced as @%mytable.
- It cannot be altered or dropped.
- It does not support setting file format options. Instead, you must specify the file format and copy options as part of the COPY INTO <table> command.
- It does not support transforming data while loading it (i.e. using a query as the source for the COPY command).
We do not go with this option if we need to copy the data in the files into multiple tables.
Internal Named Stages
It is named database objects which provides more flexibility for data loading. Because they are database objects, the security/access rules that apply to all objects apply
- Users who have appropriate privileges on the stage can load data into any table.
- Named internal stages are optional but recommended when you plan regular data loads that could involve multiple users and/or tables.
Creating Internal Named Stage
To achieve the solution for a given problem, we need to create the Internally named stage, so we can upload the files into that. Apart from creating a Stage in Snowflake, we can also create a stage for AWS, Azure, and GCP. We must provide the appropriate keys related to the cloud provider. Just an example, we create a stage with the AWS S# bucket key, then we can see all the listed files in the Snowflake stage which you have loaded to the S3 bucket. It is just created the reference, so now we can load the data into the table if the file is listed in our stage. In our scenario, we are creating a named stage in Snowflake, so uploading files into S3, we need to upload the file into the Snowflake stage. You can create a stage by GUI or SQL query. Ultimately, whatever we are passing to GUI, it creates SQL for that and runs it behind the scenes. I am creating Stage by GUI (Graphical User Interface).
Perform The Following Steps To Ceate Stage
Step 1. Login into the Snowflake account. You will be landing on the worksheet.




















Join the conversation! Your thoughts help the community grow.