by Joseph Rickert
If you are an R user and work for an enterprise where Microsoft SQL server is important, it is extremely helpful to have easy access to SQL Server databases. Over the past year, we have run several posts on this topic including a comprehensive four part series from Microsoft’s Gregory Vandenbrouck on using various flavors of SQL with Azure as a data source (Part1, Part2, Part3 and Part4) as well as several posts on using the advanced features of Microsoft R Server (formerly Revolution R Enterprise) with SQL Server 2016. (See for example this recent post Credit Card Fraud Detection with SQL Server 2016 R Services).
In this post, I would just like to describe how to connect to an Azure SQL database from your local R session. Setting up an Azure hosted database is the easiest way I know for an R user to get started with Microsoft SQL server. You don’t have to install the database, and very little SQL knowledge is necessary to begin working with a database. All of the heavy lifting is done by the Azure platform.
The only prerequisite is to get an Azure account. If you don’t already have an account, signing up for a free trial account which you can do here will give you enough credits to experiment with working with SQL Server from R.
The first step after getting an account is to login to the Azure portal. You should see a screen that looks like the figure at right.
From here, clicking on the SQL database icon and selecting “New” should bring you to a screen that looks similar to the one below. The first time you create a database you will be asked to provide a server admin logon name and a password. Remember these because …read more
Source:: r-bloggers.com