Setup R Services for SQL Server 2016

By:   |   Comments (2)   |   Related: > SQL Server 2016


Problem

In the beginning of 2015 Microsoft purchased Revolution Analytics and with that they were able to incorporate R (the most popular open source programming language for advanced analytics) inside of SQL Server bringing R processing closer to the data and eliminating the need to export SQL Server data in order to perform R processing against it.

By incorporating R processing into SQL Server 2016, Microsoft is offering R Services as a new feature that supports enterprise-scale data science. Data scientists are now able to take their existing R code and run it right inside the SQL Server database engine to support advance analytics against big data.

This is the first version of SQL Server to have an integrated support for Revolution R for statistical analysis of data embracing the highly popular open source R language with the business to facilitate a deeper insight into the data.

Let see how to setup it.

Solution

R Services for SQL Server 2016 step by step setup (only showing the relevant steps for R Service).

Step 1

R Services (In-Database) feature can be installed by using the SQL Server setup wizard.  Run SQL Server 2016 setup and on the Installation tab, click New SQL Server stand-alone installation or add features to an existing installation.

NOTE: R Services for SQL Server 2016 is not cluster aware, so it can't be installed in a failover cluster.

SQL Server setup screen

Step 2

On the Feature Selection page, select Database Engine Services and R Services (In-Database) options.  This option configures the database services used by R jobs and installs the extensions that support external scripts and processes.

NOTE: R Server (Standalone) is an option that lets you use the Scale R libraries on a Windows computer that isn't running SQL Server. Only use this option to install Microsoft R Server (Standalone) on a computer that is used for R development, to create R solutions that later can be deployed to an instance of SQL Server running R Services (In-Database).

SQL Server 2016 Setup Features Selection

Step 3

After all the configurations are set, on the page Consent to Install Microsoft R Open, click Accept

This license agreement is required to download Microsoft R Open, which includes a distribution of the open source R base packages and tools, together with enhanced R packages and connectivity providers from Revolution Analytics and by clicking on Accept the Next > button will be enabled.

NOTE: Check the next step if the computer you are using does not have internet access.

Microsoft R Open consent to install

Step 4

The following page (Offline Installation of Microsoft R Open and Microsoft R Server) will only appear if the computer you are using does not have internet access. It provides the links to download the necessary files, so this setup can be paused while you download separately the Microsoft R Open and Microsoft R Server.

After downloading the files, click Browse and provide the correct location to the previously downloaded files.

NOTE: Alternatively you can download the necessary files from this link (when performing a slipstream install provide the respective Microsoft R Open and Microsoft R Server files).

Microsoft R Open offline installation

Step 5

On the Ready to Install page, verify what selections are included and confirm by clicking on Install and when installation is complete, restart the computer.

Step 6

After restarting the computer the R Services feature needs to be enabled otherwise it will not be possible to invoke R scripts even if the feature has been installed by setup.

For that, open SQL Server Management Studio and connect to the instance where you installed R Services (In-Database) and run the following command to explicitly enable the R Services feature:

EXEC sp_configure  'external scripts enabled', 1 
GO
RECONFIGURE WITH OVERRIDE
GO

Step 7

For the changes to take effect you will need to restart the SQL Server service for the SQL Server instance. If SQL Server Trusted Launchpad service is stopped then start it also. You can restart the services by using SQL Server Configuration Manager.

SQL Server Configuration Manager - Confirm Launchpad service is started

NOTE: At this point if you are facing errors because SQL Server Launchpad service cannot be started please read this article that I wrote to solve the issue.

Step 8

After the SQL Server Launchpad starts you should be able to run simple R scripts like the following in SQL Server Management Studio.

R code example

NOTE: If the R script returns an "Unable to communicate with the runtime for 'R' script in SQL Server" error please read this article that I wrote to solve this issue.

Next Steps


sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip



About the author
MSSQLTips author Vitor Montalvao Vitor Montalvão is a SQL Server engineer with 20 years of experience in SQL Server, specializing in performance & tuning, data modelling, migration and security.

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips



Comments For This Article




Thursday, April 9, 2020 - 3:58:16 PM - Vitor Montalvão Back To Top (85318)

Hi Axita,

Which SQL Server version are you trying to install?


Sunday, April 5, 2020 - 5:09:51 PM - Axita Back To Top (85287)

In the offline installation section i downloaded two cab files placed it in C:/ drive where my MS SQL SERVER is going to be installed. Then i clicked browse and added the path to that folder but still the NEXT button is disabled. I cannot see any setup file in that cab files.

ANy suggestions will be helpful. Thank you















get free sql tips
agree to terms