Integrating R workloads and prediction operations beyond SQL Server
In this section, you will learn how to include R workloads and prediction operations that you have created in the previous sections beyond SQL Server. We will discuss how to run the workloads and operations in PowerShell, SQL Agent Job, and SQL Server Integration Services (SSIS).
Note
Please note that you can also execute these workloads/prediction operations using SQLCMD, C# within SSIS, Azure, and also Bash on Linux. This discussion is beyond the scope of this chapter.
Executing SQL Server prediction operations via PowerShell
Assuming that you have already created the stored procedure that executes R script from SQL Server, such as [dbo].[uspTrainTipPredictionModel]
from the earlier example, you can execute this command easily as part of your PowerShell workflows.
Here's a simple example of calling the stored procedure from PowerShell:
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection$SqlConnection.ConnectionString...