• We had looked for some similar way to do this and ended up implementing a R service running in a polling loop (2 sec delay) reading requests from a SQL table, executing the script in the request, and returning the output via another table.

    In addition, our implementation allows multiple R services on multiple systems to process requests from multiple SQL Server tasks (if we needed to do so.)

    We were a bit concerned about shelling out to a command prompt (security and performance). Still it is good to have this nicely detailed set of instructions.

    -----

    I also wanted to add that it seems very strange that R cannot be run within SQL Server due to incompatibilities with the embedded .NET libraries and the open source rserve program. PostgreSQL has a very nice way to call R from within a user function. I may sound uncharitable but I wonder if this isn't on purpose to encourage Windows users to use SSAS....