Getting Started with SnowSQL: Connecting to Your Snowflake Account

In this quick guide, we’ll walk through the essential steps to connect to Snowflake using SnowSQL, Snowflake’s powerful command-line interface. You’ll learn how to set up SnowSQL, configure your connection settings, and authenticate securely to your Snowflake account. Whether you’re new to Snowflake or just getting started with SnowSQL, this tutorial will provide a solid foundation to help you query and manage data in Snowflake directly from your terminal.

Read more: Getting Started with SnowSQL: Connecting to Your Snowflake Account

What is SnowSQL?

We can define it as the command line client connects to Snowflake to execute SQL queries and perform all DDL and DML operations, including loading data into and unloading data out of database tables.

How to install SnowSQL?

The process of installing SnowSQL is simple, you have to go to the Snowflake link for downloading.

Download SnowSQL

You should choose the version which is required for you. In my case, I have the Windows version.

Once you have downloaded the SnowSQL installer, you should follow the next steps as the following images show

Preparing the credentials and accessing SnowSQL

If you are using Windows, you could use Powershell and Command Prompt . In my case, I will open Command Prompt and prepare the snowsql command.

snowsql -a account_name -u User -r SYSADMIN -w COMPUTE_WH

You can get the account name from your Snowflake UI, go to your account and copy account URL, once copied, you should remove the https:// and the text .snowflakecomputing.com . The User is who has been defined by you.

At this point, you will receive a Password prompt. Once you enter it, you should be able to access the main or default DB associated with your User.

So, here, you can interact with Snowflake, in my example I does a simple query, for instance:

SHOW TABLES;

Note: If you are working interactively into Windows CMD, you can set the password variable into your session and SnowSQL will automatically read it. To initialize the password you can simply write in command line the code:

set SNOWSQL_PWD=YourPasswordHere

Conclusion

In this guide, we covered the basic steps to connect to Snowflake using SnowSQL, from installation to secure authentication. With SnowSQL, you’re equipped to run SQL queries and manage data in Snowflake seamlessly from your terminal. This foundation will help you utilize Snowflake’s full potential for efficient data operations.

geohernandez

Recent Posts

The Art of Data Modeling in AI times

In the age of artificial intelligence, where powerful algorithms analyze colossal datasets in seconds, it’s…

2 days ago

Getting Started with Snowflake’s Snowpipe for Data Ingestion on Azure

In this post, I'll explain how to take full advantage of Snowflake's Snowpipe for reliable…

2 weeks ago

Integrating Azure Blob Storage with Snowflake: A Guide to Storage Integration and Staging Data

This article offers a comprehensive, step-by-step guide for integrating Azure Blob Storage with a Snowflake…

3 weeks ago

A new step in my career as a Senior Data Architect

I am thrilled to share that I have embarked on a new professional journey as…

7 months ago

Data Modeling and its relevance in the Cloud Era

Since 2005, I've immersed myself in the dynamic world of data and its modeling. It's…

9 months ago

Formatting our Postgres scripts with pgformatter in DBeaver

Are you a PostgreSQL enthusiast using DBeaver on a Windows Platform? If you find yourself…

1 year ago