WinSQL - A Perfect Tool For Snowflake
Snowflake is an excellent solution for cloud data warehouse. Using WInSQL adds iceing on the cake. For example, you can:
- Integrate data coming from Snowflake in MS Excel
- Import tabular data from CSV files or MS Excel sheets into Snowflake tables
- You can extract, transform and load (ETL) directly from another database into Snowflake. For example, you can run a SELECT query into an Oracle DB and INSERT the results in a Snowflake table
- Draw E/R diagrams representing the design visually
- Generate code in Java, C# and PHP that performs CRUD operations on Snowflake data
This page talks about how to connect to a Snowflake database and run some basic queries.
Prerequisites
- Download the ODBC driver from Snowflake Client Repository
- Create a Data Source referring to your Snowflake database. Refer to the screenshot below.
Note Use your assigned URL without protocol for the server name.
- Once a DSN is created, you connect from WinSQL. The following screenshot display a simple query that is executed on a database running on MS Azure.
Configuration Change
The SQL syntax in Snowflake requires every object (table names and fields) are enclosed in double-quotes. For example, running the following query could result in an error:
select CC_NAME, CC_CLASS
from TPCDS_SF100TCL.CALL_CENTER
A better way to run the following query instead:
select "CC_NAME", "CC_CLASS"
from "TPCDS_SF100TCL"."CALL_CENTER"
On several occasions WinSQL runs SELECT statements in the background. Therefore, you should configure WinSQL to automatically enclose table and column names when generating SELECT statements. This is done by clicking
Edit/Options and selecting the
Force quoted identifiers under the
Intelli Tips tab. See image below for reference.