What is SQL Server Language Extensions?

Applies to: yesSQL Server 2019 (15.x)

Language Extensions is a feature of SQL Server used for executing external code. The relational data can be used in the external code using the extensibility framework. In SQL Server 2019, Java, Python, and R runtimes are supported.


For executing Python or R in SQL Server, see the Machine Learning Services documentation. With SQL Server 2019 and later, you can use a custom Python and R runtime with Language Extensions. For more information, see how to install the Python custom runtime and the R custom runtime.

What you can do with Language Extensions

Language Extensions uses the extensibility framework for executing external code. Code execution is isolated from the core engine processes, but fully integrated with SQL Server query execution. You can execute code at the data's source, eliminating the need to pull data across the network.

External languages are defined with CREATE EXTERNAL LANGUAGE. The system stored procedure sp_execute_external_script is used as the interface for executing the code.

Language Extensions provides multiple advantages:

  • Data security. Bringing external language execution closer to the source of data avoids insecure data movement.
  • Speed. Databases are optimized for set-based operations.
  • Ease of deployment and integration. SQL Server is the central point of operations for many other data management tasks and applications. By using data in the database, you ensure that the data used by the language extension is consistent and up-to-date.

Next steps