SQL Server 2016 SP1 - Unable to execute R code I have SQL Server 2016 SP1 installed, with R Services. I believe I configued everything based on what I understood to be correct and the output below. 



I have restarted SQL Server services and the Launcher services. When I attempt to execute the following test code:

EXEC sp_execute_external_script  
  @language =N'R',    
  @script=N'OutputDataSet&lt;-InputDataSet',      
  @input_data_1 =N'SELECT 1 AS hello'    
  WITH RESULT SETS (([hello] int not null));    
GO   


I get the following error:

Msg 39021, Level 16, State 1, Line 1
Unable to launch runtime for 'R' script. Please check the configuration of the 'R' runtime.
Msg 39019, Level 16, State 1, Line 1
An external script error occurred: 
Unable to launch the runtime. ErrorCode 0x80070057: 87(The parameter is incorrect.).


If it helps, my rlauncher.config files looks as follows:

RHOME=D:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\R_SERVICES
MPI_HOME=C:\Program Files\Microsoft MPI
INSTANCE_NAME=MSSQLSERVER
TRACE_LEVEL=1
JOB_CLEANUP_ON_EXIT=1
USER_POOL_SIZE=0
WORKING_DIRECTORY=C:\Temp


I'm at a bit of a loss to determine how to fix this.
We ran into a number of problems when trying to configure R-Services, but we eventually got it working.  Please refer to the following link for the details.

Problem getting Sql Server 2016 R Services (In-Database) working