Press "Enter" to skip to content

Connecting to SQL Server from R

Thomas Williams makes a database call:

R code (including in R Markdown and Shiny) can connect to databases, for both reading and writing. This opens up a whole world of powerful analysis – however, it can sometimes be tricky to deal with drivers, error handling and closing connections. In this post, I’ll demonstrate how to connect to a SQL Server database and run a query; in part 2, I’ll cover some of the things you might want to do with the query results.

Click through for two common libraries and a few tips.