Adding this here to save the steps for when I need to setup additional Mac machines or need to update one. The purpose of setting this up is to be able to connect to MSFT SQL Servers from a Mac directly from R.
- Install homebrew if not already installed.
- Install the version of the driver that you want to use. I use ODBC Driver 17 for SQL Server.
- Tell R where to find the driver by adding the path to the .Renviron file. To find the location of this file, run:
in R. Then, add this line to the .Renviron fileR.home(component = "home"). (Note that you should “show hidden files” if you’re using Mac’s Finder.)ODBCSYSINI=/opt/homebrew/etc
- Close R and start a new session. You should be good to go.