Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R and SQL Server 2008

Is there a way to use R power in SQL Server 2008?, I mean use in console or communicate both of them.
If it is What would be the procedure?

like image 773
edgarmtze Avatar asked Dec 22 '22 15:12

edgarmtze


1 Answers

SQL Server Data Within R:

An example using SQL Server data within R is here. This blog post deals with plotting data from a SQL server table using K-Means Clustering.

Calling R within SQL Server:

You can use the extended Stored Procedure XP_CmdShell to call R (or any command line tool as Nick points out) within SQL Server.

Enable Functionality In Server Level:

XP_CmdShell exposes the cmd shell within SQL Server. For obvious reasons, this is not enabled by default. A SysAdmin (or someone with Control Server permission) can enable this functionality in server level.

Enable a specific User to Access this functionality:

 exec ON xp_cmdshell TO *YourLoginHere*

Refer this URL for more info on best practices (such as using a proxy account for non-SysAdmin users) and example usage.

like image 181
Jeganinfo Avatar answered Jan 02 '23 15:01

Jeganinfo