This is my second article on using Microsoft’s new Linux version of SQL Server with R. This time, I’ll cover how to use RODBC to gather data from SQL Server. As a bit of background, over the past few months, I have been working to learn R, a free software environment for statistical computing. Its been gaining popularity over the past few years, and Microsoft just gave it a huge boost by integrating R into their Power BI visualization software and in the Windows version of SQL Server 2016. Since a good deal of my work involves connecting to Microsoft SQL Servers its a good opportunity to show how to connect to a SQL Server installed on Ubuntu from R using ODBC.
For this tutorial, I am going to assume that you already have R installed. For my purposes, I am running R on the same Ubuntu machine as the SQL Server. If you need instructions for installing SQL Server on Linux, Microsoft has provided a write-up already. So now let’s get started.