Architecture overview for Machine Learning Services with Python

THIS TOPIC APPLIES TO: yesSQL Server (Windows only)noAzure SQL DatabasenoAzure SQL Data WarehousenoParallel Data Warehouse

This article provides an overview of how Python is integrated with SQL Server, including the security model, the components in the database engine that support external script execution, and new components that enable interoperability of Python with SQL Server. For details, see the linked articles.


Support for Python is available beginning with SQL Server 2017 CTP 2.0. This pre-release feature is subject to change.

Python interoperability

SQL Server Machine Learning Services (In-Database) installs the Anaconda distribution of Python, and the Python 3.5 runtime and interpreter. This ensures near-complete compatibility with standard Python solutions. Python runs in a separate process from SQL Server, to guarantee that database operations are not compromised.

For more information about the interaction of SQL Server with Python, see Python interoperability

Components that support Python integration

The extensibility framework introduced in SQL Server 2016 now supports execution of Python script, through the addition of new language-specific components. These components improve data exchange speed and compression, while providing a secure, high-performance platform for running external scripts.

For detailed description of the components that support Python, such as the SQL Server Trusted Launchpad and PythonLauncher, see New Components.


Python tasks execute outside the SQL Server process, to provide security and greater manageability.

All tasks are secured by Windows job objects or SQL Server security. Data is kept within the compliance boundary by enforcing SQL Server security at the table, database, and instance level. The database administrator can control who has the ability to run Python jobs, monitor the use of Python scripts by users, and view the resources consumed.

For details, see Security for Python

Resource governance

In SQL Server Enterprise Edition, you can use Resource Governor to manage and monitor resource use of external script operations, including R script and Python scripts.

For more information, see Resource Governance for R.

Next steps

Run Python using T-SQL