Enabling sp_execute_external_script to run R scripts in SQL Server 2016

July 26, 2016
By

(This article was first published on R – TomazTsql, and kindly contributed to R-bloggers)

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.

To leave a comment for the author, please follow the link and comment on their blog: R – TomazTsql.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)