| title | Prerequisites for the data science walkthrough for SQL Server and R | Microsoft Docs |
|---|---|
| ms.prod | sql |
| ms.technology | machine-learning |
| ms.date | 04/15/2018 |
| ms.topic | tutorial |
| author | HeidiSteen |
| ms.author | heidist |
| manager | cgronlun |
[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md-winonly]
We recommend that you do this walkthrough on a laptop or other computer that has the Microsoft R libraries installed. You must be able to connect, on the same network, to a [!INCLUDEssNoVersion] computer with machine learning services and the R language enabled.
You can run the walkthrough on a computer that has both [!INCLUDEssNoVersion] and an R development environment but we don't recommend this configuration for a production environment.
You must have access to an instance of SQL Server with support for R installed. This walkthrough was originally developed for SQL erver 2016 and tested on 2017, so you should be able to use either of the following SQL Server versions. (There are some small differences in the RevoScaleR functions between the releases.)
- Machine Learning Services (In-Database) for SQL Server 2017
- SQL Server 2016 R Services
For more information, see Install SQL Server 2017 Machine Learning Services or Install SQL Server 2016 R Services.
Important
SQL Server versions earlier than 2016 do not support integration with R. However, you can use older SQL databases as an ODBC data source.
For this walkthrough, we recommend that you use an R development environment. Here are some suggestions:
-
R Tools for Visual Studio (RTVS) is a free plug-in that provides Intellisense, debugging, and support for Microsoft R. YOu can use it with both R Server and SQL Server Machine Learning Services. To download, see R Tools for Visual Studio.
-
Microsoft R Client is a lightweight development tool that supports development in R using the RevoScaleR package. To get it, see Get Started with Microsoft R Client.
-
RStudio is one of the more popular environments for R development. For more information, see https://www.rstudio.com/products/RStudio/.
You cannot complete this tutorial using a generic installation of RStudio or other environment; you must also install the R packages and connectivity libraries for Microsoft R Open. For more information, see Set Up a Data Science Client.
-
Basic R tools (R.exe, RTerm.exe, RScripts.exe) are also installed by default when you install R in SQL Server or R Client. If you do not wish to install an IDE, you can use these tools.
To connect to an instance of [!INCLUDEssNoVersion] to run scripts and upload data, you must have a valid login on the database server. You can use either a SQL login or integrated Windows authentication. Ask the database administrator to configure the following permissions for the account, in the database where you use R:
- Create database, tables, functions, and stored procedures
- Write data into tables
- Ability to run R script (
GRANT EXECUTE ANY EXTERNAL SCRIPT to <user>)
For this walkthrough, we have used the SQL login RTestUser. We generally recommend that you use Windows integrated authentication, but using the SQL login is simpler for some demo purposes.
-
This sample was originally developed using SQL Server 2016 R Services. However, breaking changes were introduced in the Microsoft R components for 2016 SP1. Specifically, the varsToDrop and varsToKeep parameters were no longer supported for SQL Server data sources. Therefre, if you downloaded a version of the tutorial prior to SP1, it will no longer work with post-SP1 builds.
-
The current version of the sample has been tested using a pre-release build of SQL Server 2017 Machine Learning Services (RC1 and RC2). In general, almost all steps should run without modification between 2016 SP1 and 2017.