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 AccountContents
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.
The process of installing SnowSQL is simple, you have to go to the Snowflake link for downloading.
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
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
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.
In the age of artificial intelligence, where powerful algorithms analyze colossal datasets in seconds, it’s…
In this post, I'll explain how to take full advantage of Snowflake's Snowpipe for reliable…
This article offers a comprehensive, step-by-step guide for integrating Azure Blob Storage with a Snowflake…
I am thrilled to share that I have embarked on a new professional journey as…
Since 2005, I've immersed myself in the dynamic world of data and its modeling. It's…
Are you a PostgreSQL enthusiast using DBeaver on a Windows Platform? If you find yourself…