Revolution R now available with SQL Server Community Preview

[This article was first published on Revolutions, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The new SQL Server 2016 is now available as part of the Community Technical Preview program, and as presaged it embeds connectivity with the R language and the big-data statistical algorithms of Revolution R Enterprise.

SQL Server 2016 includes two ways of calling R. The first is by embedding R code direcly in a SQL Stored Procedure, which can then be called by other applications to embed charts or tables created by R using data in the database.


The second way allows you to use the RevoScaleR package in Revolution R Enterprise (included with SQL Server 2016) to create statistical models using data in SQL Server 2016, and use the computing power of the database to fit the model. The process in R is follows:

  • Make a connection to the SQL Server 2016 database (using login credentials)
  • Create an object referencing a table or query in SQL Server 2016
  • Instruct Revolution R Enterprise to perform computations in the database (by setting the “compute context” to SQL Server 2016)
  • Use one of the RevoScaleR “rx” functions to fit the model, using a syntax similar to standard R functions.

Heres some code demonstrating fitting a linear regression on the famous “airlines” data set, as stored in the database (and for more background, see this blog post by Andrie de Vries):

SQL Model

For more on the new features in SQL Server 2016 and how to access the Community Technology Preview, follow the link below.

SQL Server blog: SQL Server 2016 Community Technology Preview 3.0 is available

To leave a comment for the author, please follow the link and comment on their blog: Revolutions. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)