Snowflake Solutions Expertise and
Community Trusted By

Enter Your Email Address Here To Join Our Snowflake Solutions Community For Free

Snowflake Solutions Community

I’m having trouble connecting to Snowflake from R. Any suggestions?

7.96K viewsErrors and Troubleshooting
0

I'm having trouble connecting to Snowflake from R. Any suggestions?

Gisele Casillas Answered question December 30, 2021
0

If you want to connect to Snowflake from R (RStudio) you will need to use the ODBC (Open Database Connectivity) driver on either Windows, MacOS, or Linux.

Here are some steps on how to do this:

1. The first step is to create an ODBC DSN (Data Source Name)
2. Then you will test if the ODBC DSN is working
3. Lastly, the code that can be used on RStudio is:

install.packages(c("DBI", "dplyr","dbplyr","odbc"))
library(DBI)
library(dplyr)
library(dbplyr)
library(odbc)
myconn <- DBI::dbConnect(odbc::odbc(), "SNOWFLAKE_DSN_NAME", uid="USERNAME", pwd='Snowflak123')
mydata <- DBI::dbGetQuery(myconn,"SELECT * FROM EMP")
head(mydata)

Gisele Casillas Answered question December 30, 2021

Sign in with google.com

To continue, google.com will share your name, email address, and profile picture with this site.

Harness the Power of Data with ITS Solutions

Innovative Solutions for Comprehensive Data Management

Feedback on Q&A