Cursor Follower
snowflake:SnowSQL Logo

Connecting Snowflake with SnowSQL

Celestinfo Software Solutions Pvt. Ltd. May 12, 2025

Introduction

SnowSQL, Snowflake’s command-line interface (CLI), is a versatile tool that goes far beyond loading data into Snowflake’s cloud data platform. While it’s great for transferring local files to Snowflake, SnowSQL also empowers you to execute SQL queries, manage database objects, automate workflows, and handle advanced data operations—all from your terminal. In this blog, we’ll explore SnowSQL’s full range of capabilities with practical examples, making it easy for beginners and seasoned data professionals to harness its power.

What is Snowsql?

SnowSQL is a powerful CLI tool designed to connect to snowflake’s cloud platform. It allows users to:

Setting Up SnowSQL

Before diving into queries, let’s set up SnowSQL on your machine.

Download SnowSQL:

Visit the Snowflake SnowSQL download page and select the installer for your operating system(Windows, macOS, or Linux).

AWS Console Home

Install SnowSQL:

Run the installer and follow the wizard prompts.

S3 Service Dashboard

After the installation by checking the version in your terminal by using below syntax.

S3 Service Dashboard
S3 Service Dashboard

Enter the give command. The account name or identifier and login name are shown in snowflake Account Details. Copy and past the account identifier and username in the command and click enter.

S3 Service Dashboard
S3 Service Dashboard

Type your password and click enter. If your password is correct, then you will see like this.

S3 Service Dashboard

If successful, you can have access to snowflake.

Loading Data from local to snowflake Using SnowSQL

Loading data into Snowflake involves two main steps: staging the file and copying it into a table. Follow these steps:

After connecting to the Snowflake, create a database and use public schema(default).can also access the other database, according to the role privileges.

S3 Service Dashboard
S3 Service Dashboard

Create a Target to store the data:

S3 Service Dashboard
S3 Service Dashboard

Create Stage for storing the file:

S3 Service Dashboard
S3 Service Dashboard

Stage the File:

S3 Service Dashboard
S3 Service Dashboard

Copy Data into the Table:

Load the staged file into the table.

S3 Service Dashboard
S3 Service Dashboard

This command specifies the file format (CSV), skips the header row.

Verifying the load

To ensure the data loaded correctly, query the table:

S3 Service Dashboard
S3 Service Dashboard

What else can do with snowsql?

By using SnowSQL, can also manage roles, user, warehouses and so many. Showing you some basic uses of the SnowSQL.

A basic command to show all the roles in snowflake.

S3 Service Dashboard
S3 Service Dashboard

What else can do with snowsql?

By using SnowSQL, can also manage roles, user, warehouses and so many. Showing you some basic uses of the SnowSQL.

A basic command to show all the roles in snowflake.

S3 Service Dashboard
S3 Service Dashboard

To Create a Role

A role in Snowflake defines a set of permissions that can be assigned to users. Use the CREATE ROLE command to create a new role.

S3 Service Dashboard
S3 Service Dashboard

Grant Usage to the Role

To have access to database or schema, role should have privileges to access. To give access to roles:

S3 Service Dashboard
S3 Service Dashboard

Creating a schema using SnowSQL.

S3 Service Dashboard
S3 Service Dashboard
S3 Service Dashboard
S3 Service Dashboard

Create a user and grant to role

S3 Service Dashboard
S3 Service Dashboard

Granting user to the role

S3 Service Dashboard
S3 Service Dashboard

To access the user, again start from command prompt and login using the new user login details with same account identifier.

Creating a warehouse

S3 Service Dashboard
S3 Service Dashboard

Use the below syntax to see all the warehouses in the account.

S3 Service Dashboard
S3 Service Dashboard

Conclusion

SnowSQL is more than a data-loading tool. It’s a gateway to managing and interacting with Snowflake from the command line. From executing SQL queries and managing objects to automating tasks and handling advanced data operations, SnowSQL empowers you to streamline your data workflows. Try these examples, experiment with scripts, and explore SnowSQL’s features to unlock Snowflake’s full potential.

Burning Questions
About CelestInfo

Simple answers to make things clear.

How accurate are the AI insights?+

Our AI insights are continuously trained on large datasets and validated by experts to ensure high accuracy.

Can I integrate with my existing tools?+

Absolutely. CelestInfo supports integration with a wide range of industry-standard software and tools.

What security measures do you have?+

We implement enterprise-grade encryption, access controls, and regular audits to ensure your data is safe.

How often are insights updated?+

Insights are updated in real-time as new data becomes available.

What kind of support do you offer?+

We offer 24/7 support via chat, email, and dedicated account managers.

Still have questions?

Ready? Let's Talk!

Get expert insights and answers tailored to your business requirements and transformation.