How to read Snowflake data from SQL Server

Aman Raiyyani
How to read Snowflake data from SQL Server

To read data from a Snowflake database into SQL Server, you can use the following methods:

Use the SQL Server Integration Services (SSIS) to create a package that transfers data from Snowflake to SQL Server.

Use the Snowflake Data Provider for SQL Server to create a linked server in SQL Server that connects to Snowflake, allowing you to use Transact-SQL (T-SQL) to query the Snowflake data.

Use the Snowflake JDBC driver to create a connection to Snowflake from SQL Server and use T-SQL to query the data.

Use a third-party tool such as Talend, Fivetran, or Dataform to automate the data transfer between Snowflake and SQL Server.

You will need to have a Snowflake account, and the proper credentials to access the data. And also you should have the correct version of Snowflake driver in your SQL Server.

Here is an example of how to read data from a Snowflake table into a SQL Server table using the SQL Server Integration Services (SSIS) package:

Create a new SSIS package and add a Data Flow Task to the Control Flow tab.

Inside the Data Flow Task, add a Snowflake Source component and configure it to connect to your Snowflake account using your credentials.

In the Snowflake Source component, specify the table or query that you want to read data from.

Add a SQL Server Destination component to the Data Flow Task and configure it to connect to your SQL Server instance.

In the SQL Server Destination component, specify the table that you want to insert the data into.

Map the columns from the Snowflake Source component to the SQL Server Destination component.

Run the SSIS package and the data from the Snowflake table will be transferred to the SQL Server table.

Please note that you need to have SQL Server Data Tools (SSDT) and Snowflake ADO.NET provider installed in your machine to be able to use the Snowflake Source component.

Here is an example of how to create a linked server in SQL Server that connects to a Snowflake database and query data from it using Transact-SQL (T-SQL):

Open SQL Server Management Studio (SSMS) and connect to your SQL Server instance.

In the Object Explorer, right-click on the “Linked Servers” folder and select “New Linked Server.”

In the “New Linked Server” dialog box, enter a name for the linked server (e.g. “SNOWFLAKE”) and select “Other data source” as the provider.

In the “Provider” field, select “SnowflakeDSI”

In the “Data source” field, enter the name of your Snowflake account (e.g. “myaccount.snowflakecomputing.com”).

In the “Location” field, enter the name of the Snowflake warehouse and database you want to connect to (e.g. “MYWAREHOUSE/MYDATABASE”).

In the “Provider string” field, enter the connection string including your account name, username, and password.

Click “OK” to create the linked server.

You can now query the data from the Snowflake table by using the following T-SQL query:

SELECT * FROM SNOWFLAKE...MYTABLE

Please note that you need to have Snowflake Data Provider for SQL Server, and the correct version of it, installed on your machine.

Also, you need to have the correct permissions to access the Snowflake warehouse and database.

Please also note that for security reason, it is recommended to use the “Security” tab in the Linked Server properties to map the local login to a Snowflake user.

Explore our range of trailblazer services

Risk and Health Audit

Get 360 degree view in to the health of your production Databases with actionable intelligence and readiness for government compliance including HIPAA, SOX, GDPR, PCI, ETC. with 100% money-back guarantee.

DBA Services

The MOST ADVANCED database management service that help manage, maintain & support your production database 24×7 with highest ROI so you can focus on more important things for your business

Cloud Migration

With more than 20 Petabytes of data migration experience to both AWS and Azure cloud, we help migrate your databases to various databases in the cloud including RDS, Aurora, Snowflake, Azure SQL, Etc.

Data Integration

Whether you have unstructured, semi-structured or structured data, we help build pipelines that extract, transform, clean, validate and load it into data warehouse or data lakes or in any databases.

Data Analytics

We help transform your organizations data into powerful,  stunning, light-weight  and meaningful reports using PowerBI or Tableau to help you with making fast and accurate business decisions.

Govt Compliance

Does your business use PII information? We provide detailed and the most advanced risk assessment for your business data related to HIPAA, SOX, PCI, GDPR and several other Govt. compliance regulations.

You May Also Like…