I’m having trouble connecting to Snowflake from R. Any suggestions?
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:
myconn <- DBI::dbConnect(odbc::odbc(), "SNOWFLAKE_DSN_NAME", uid="USERNAME", pwd='Snowflak123')
mydata <- DBI::dbGetQuery(myconn,"SELECT * FROM EMP")