| title | Server Configuration: external scripts enabled | ||
|---|---|---|---|
| description | Learn about the external scripts enabled option in SQL Server. After turning it on, you can execute external scripts in supported languages such as R or Python. | ||
| author | MikeRayMSFT | ||
| ms.author | mikeray | ||
| ms.reviewer | randolphwest | ||
| ms.date | 08/26/2025 | ||
| ms.service | sql | ||
| ms.subservice | machine-learning-services | ||
| ms.topic | how-to | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| monikerRange | >=sql-server-2016 || >=sql-server-linux-ver15 || =azuresqldb-mi-current |
[!INCLUDE sqlserver2016-asdbmi]
Use the external scripts enabled option to enable the execution of scripts with certain remote language extensions. This property is OFF by default. When Machine Learning Services is installed, setup can optionally set this property to true.
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 [!INCLUDE sssql16-md]
[!INCLUDE rsql_productname] includes support for the R language in [!INCLUDE sssql16-md], and a set of R workstation tools and connectivity libraries.
Install the R Services feature during [!INCLUDE ssNoVersion] setup to enable the execution of R scripts.
-
For [!INCLUDE sssql17-md] and later
[!INCLUDE rsql-productnamenew-md] has support for both the R and Python languages.
Install the Machine Learning Services feature during [!INCLUDE ssNoVersion] 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.
-
For [!INCLUDE sssql19-md] and later [!INCLUDE rsql-productnamenew-md] has support for all R, Python, Java and other third party languages.
Install the Machine Learning Services and Language Extensions feature during [!INCLUDE ssNoVersion] setup to enable the execution of external scripts for any supported language.
After setup, to enable external scripts, execute the following script:
EXECUTE sp_configure 'external scripts enabled', 1;
RECONFIGURE WITH OVERRIDE;For more information, see Install SQL Server Machine Learning Services (Python and R) on Windows or Linux.