SQL Server Machine Learning Services
SQL Server 2017 Machine Learning Services (previously SQL Server 2016 R Services) provides a platform for developing and deploying intelligent applications that uncover new insights. You can use the rich and powerful R language and the many packages from the community to create models and generate predictions using your SQL Server data.
Because machine learning is integrated with SQL Server, you can keep analytics close to the data and eliminate the costs and security risks associated with data movement.
SQL Server supports the open source R language with a comprehensive set of tools and technologies that offer superior performance, security, reliability, and manageability. You can deploy R solutions using convenient, familiar SQL tools, and your production applications can call the R runtime and retrieve predictions and visuals using Transact-SQL. You also get the Microsoft R libraries to improve the scale and performance of your R solutions, including RevoScaleR, revoscalepy, and MicrososftML.
Through SQL Server setup, you can install both server and client components.
Machine learning in SQL Server 2017
Install Machine Learning Services (In-Database) during SQL Server setup to enable secure execution of R or Python scripts on the SQL Server computer.
When you select this feature, extensions are installed in the database engine to support execution of code written in R or Python. A new service is created, the SQL Server Trusted Launchpad, to manage communications between the external runtimes and the SQL Server instance.
Install Microsoft Machine Learning Server (Standalone) on a separate computer if you don't need to use SQL Server as the compute context. Machine Learning Server includes the same machine learning components, plus the ability to execute scalable, distributed machine learning jobs as a web service.
Install Microsoft R Client on remote computers to develop solutions that can be deployed to SQL Server, or to Machine Learning Server on Windows, Linux, or Hadoop.
Machine learning in SQL Server 2016
Install R Services (In-Database) during setup of SQL Server 2016 to enable secure execution of R scripts on the SQL Server computer.
When you select this feature, you get the ability to run R script using the SQL Server as the compute context, or to run R script in a stored procedure.
Install Microsoft R Server (Standalone) from SQL Server 2016 setup, to install the R components on a separate computer that you can use for developing or deploying R solutions.
Which type of machine learning service do I need?
If you need to run your R code in SQL Server, either by using stored procedures or by using the SQL Server instance as the compute context, you must install R Services (In-Database) as described here.
Microsoft Machine Learning Server (Standalone) is a separate option designed for using the Microsoft R and related Python libraries on a Windows computer that is not running SQL Server. It does, however, require an Enterprise Edition license for SQL Server.
We recommend that you install Microsoft Machine Learning Server (Standalone) on a laptop or other remote computer used for development, and use that computer to create and test machine learning solutions that can easily be deployed to an instance of SQL Server that is running Machine Learning Services (In-Database) or another supported compute context.
You can also use the mrsdeploy package that is installed with Machine Learning Server to publish and distribute R and Python jobs as a web service.
Describes common scenarios for uses of R with SQL Server
Install R and associated database components as part of SQL Server setup
Learn how to create SQL Server data sources in your R code, and how to use remote compute contexts. Other tutorials aimed at SQL developers demonstrate how to train and deploy an R model in SQL Server.