Enabling sp_execute_external_script to run R scripts in SQL Server 2016

SP_EXECUTE_EXTERNAL_SCRIPT is a stored procedure that execute provided script as argument on external script to a provided language (in this case R language). To enable normal function of this external stored procedure, you must have administrator access to your SQL Server instance in order to run sp_configure command (and set following configuration):

EXECUTE sp_configure;
GO

To enable execution of external script add an argument:

EXECUTE sp_configure 'external scripts enabled', 1;
GO

And after that run the reconfiguration as:

RECONFIGURE;
GO

This is a standard procedure to do so, also described on BOL for running sp_execute_external_script.

But I have seen too many people struggling with this; after running this reconfigure on sp_configure they still get run value for external scripts enabled set to 0.

2016-07-26 09_45_44-

Which literally means that execution of R script will not work.

In this case go to services and restart service: SQL Server Launchpad (SQLSERVER).

Capture

 

And this will take affect that run_value will be set to 1.

Capture2

Enjoy coding T-SQL and R.

Advertisements