In this tutorial, I will explain how to fix unable to communicate with the runtime for ‘R’ script. Please check the requirements of ‘R’ runtime, Fatal error: cannot create ‘R_TempDir’. R is the most popular programming language for advanced analytics today. You can use it for statistical analysis, uncover patterns, identify trends or even build predictive models. R has a massive collection of free packages on CRAN created by an ever-growing worldwide developer community.

In the latest SQL Server 2016 CTP3 release, new native in-database support for open source R and multi-threaded RevoScaleR functions are now available via R Services. SQL Server R Services provides a platform for using the powerful R language and package portfolio with a simple Transact-SQL interface. To overcome open source R’s performance and scale limitations, Enterprise Edition includes RevoScaleR features.

Data scientists, BI developers and applications can make parameterized calls to the R runtime from SQL code or stored procedures to get R computed result sets or data visualizations. In SQL Server 2016 CTP3, support for ad-hoc execution of R scripts via a new system stored procedure, sp_execute_external_script, was added. It will currently support pushing data from a single SELECT statement with multiple input parameters to R and return a single data frame as output.

  • Locate launcher config file (this is used by the MSSQL Launch pad service)
    • Its normally located in the Binn folder instance the which is available in the root directory in my case D: \ Program Files \ Microsoft SQL Server \ MSSQL 13.MSSQLSERVER \ MSSQL \ Binn
  • View the contents of rlauncher and check the working directory of the which is where we are having issues creating temp dir.
    • R does not like spaces in the working directory
    • R launcher 1

  • Create a folder in C:\ called temp “C:\temp”
  • Change the working directory to c:\temp
  • R launcher 2

  • Grant permissions for the service MSSQLaunchpad service account in my case its NT Service\MSSQLaunchpad
  • R launcher 3

    Restart the SQL server services and SQL Launch pad services.
    We can also fix this by using short paths by replacing the working directory with a short path. Example below cmd will give us the short path for the location cmd /c for %A in (“D:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\ExtensibilityData”) do @echo %~sA

     SQL 2016 Hosting
European best, cheap and reliable ASP.NET hosting with instant activation. is #1 Recommended Windows and ASP.NET hosting in European Continent. With 99.99% Uptime Guaranteed of Relibility, Stability and Performace. security team is constantly monitoring the entire network for unusual behaviour. We deliver hosting solution including Shared hosting, Cloud hosting, Reseller hosting, Dedicated Servers, and IT as Service for companies of all size.