SQL Server 2017 Machine Learning Services with R
上QQ阅读APP看书,第一时间看更新

Configuring the environment and installing R Tools for Visual Studio (RTVS)

Once the installation is completed, there are some post installation processes that need to be executed.

The external script server must be enabled so that stored procedures can call external script. In order to do so, run the following command against your SQL Server instance, where you have installed R Services (in-database):

EXEC sp_configure 'show advanced options',1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'external scripts enabled';
GO  

If you are running this for the first time, it is disabled by default so enabling it is a must; otherwise, running the sp_execute_external_script procedure will not be possible:

EXEC sp_configure 'external scripts enabled', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO  

You can always check whether the run_value of external scripts enabled is set to 1, as follows:

Figure 8: Setting up sp_configure

If the server configuration does not take effect, you need to restart the SQL Server service.Under services, find your MSSQLSERVER Service name and restart it (Stop and Start):

Figure 9: Checking MSSQLSERVER service

Restarting the MSSQLSERVER service will automatically restart all the dependent services, along with the MSSQLLaunchpad service. After the restart of the server, the external script will be enabled.

After the post installation process has finished, security can be set. It is optional, as the default database readers are already set, but, based on your company's environment you are advised to look into this and set it up properly.

In addition, you will need to install R Tools for Visual Studio (RTVS). To do this, Visual Studio 2015 or higher is needed and, once VS2015+ is installed, you need to download the RTVS itself from the Visual Studio website (https://www.visualstudio.com/vs/rtvs/). The installation process from that point is straightforward and does not need any further instructions now.