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

One thought on “Enabling sp_execute_external_script to run R scripts in SQL Server 2016

  1. If this does not work, just remeber that the account running the SQL server Launchpad service must have enough rights to work on SQL Server. If you do not know wich is that level, remeber that the Administrator has enough rights. 🙂

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s