External Scripts Enabled server configuration option

THIS TOPIC APPLIES TO: yesSQL ServernoAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Applies to: SQL Server 2016 R Services (In-Database) and SQL Server 2017 Machine Learning Services (In-Database)

Use the external scripts enabled option to enable the execution of scripts with certain remote language extensions. This property is OFF by default. When Advanced Analytics Services is installed, setup can optionally set this property to true.

Remarks

You must enable the external script enabled option before you can execute an external script using the sp_execute_external_script procedure. Use sp_execute_external_script to execute scripts written in a supported language such as R or Python.

  • For SQL Server 2016

    R Services (In-Database) includes support for the R language in SQL Server 2016, and a set of R workstation tools and connectivity libraries.

    Install the Advanced Analytics Extensions feature during SQL Server setup to enable the execution of R scripts. The R language is installed by default.

  • For [SQL Server 2017

    Machine Learning Services (In-Database) uses the same architecture as in SQL Server 2016, but provides support for the Python language.

    Install the Advanced Analytics Extensions feature during SQL Server setup to enable the execution of external scripts. Be sure to select at least one language during initial setup: either R or Python, or both.

Additional requirements

After setup, to enable external scripts, execute the following script:

sp_configure 'external scripts enabled', 1;
RECONFIGURE WITH OVERRIDE;  

You must restart SQL Server to make this change effective.

For more information, see Set up SQL Server Machine Learning.

See also

sp_configure (Transact-SQL)

RECONFIGURE (Transact-SQL)

sp_execute_external_script (Transact-SQL)

SQL Server Machine Learning Services