5

I am evaluating SQL Server 2016 in-database integration with R on Windows 10. I have followed the steps installed all components and scripts. Now I have following questions:

Where does sp_execute_external_script reside? I can’t find it. When I run script, for example:

execute sp_execute_external_script @language = N'R' , @script = N' OutputDataSet <- InputDataSet;' , @input_data_1 = N' SELECT TOP 100 [BusinessEntityID] FROM [AdventureWorks2014].[Person].[Person];';

I got error:

“Msg 39021, Level 16, State 1, Line 1 Unable to launch runtime for 'R' script. Please check the configuration of the 'R' runtime. Msg 39019, Level 16, State 1, Line 1 An external script error occurred: Unable to launch the runtime. ErrorCode 0x80070490: 1168(Element not found.).”

Based on the above suggestion, I rerun the script, but it does not solve the problem.

Any suggestions are greatly appreciated.

Lukasz Szozda
  • 162,964
  • 23
  • 234
  • 275
Frank
  • 156
  • 2
  • 6

4 Answers4

6

RegisterRExt post installation configuration needs to specify the correct instance name as per this MSDN article .

You can run the following commands to fix your issue:

"%programfiles%\RRO\RRO-3.2.2-for-RRE-7.5.0\R-3.2.2\library\RevoScaleR\rxLibs\x64\RegisterRExt" /uninstall

"%programfiles%\RRO\RRO-3.2.2-for-RRE-7.5.0\R-3.2.2\library\RevoScaleR\rxLibs\x64\RegisterRExt" /install /instance:InstanceName

Arun Gurunathan
  • 306
  • 1
  • 5
  • Only this approach helped me with this issue, thanks for pointing to it. Just want to add that path to the executable was changed in the RTM. RegisterRExt is located here for default instance: C:\Program Files\Microsoft SQL Server\130\R_SERVER\library\RevoScaleR\rxLibs\x64\RegisterRExt – Denis Reznik Sep 28 '16 at 10:53
1

sp_execute_external_script is in the Extended Stored Procedures node in the 'master' database of the installed instance of SQL Server 2016

user2063329
  • 443
  • 2
  • 5
  • 15
0

Can you please confirm you ran both R provider installation & Post-installation steps below?

Install R Packages and Providers for SQL Server R Services

Post-Installation Server Configuration (SQL Server R Services)

If you are still facing errors, can you share log from RegisterRExt.log from this location:

"%programfiles%\RRO\RRO-3.2.2-for-RRE-7.5.0\R-3.2.2\library\RevoScaleR\rxLibs\x64\RegisterRExt.log"

Arun Gurunathan
  • 306
  • 1
  • 5
  • I confirm I ran all the above. And I can't find anything related to sp_execute_external_script in the RegisterRExt.log. The log info is too long to paste. – Frank Nov 20 '15 at 00:15
  • RegisterRExt.log is here: https://www.dropbox.com/s/r9jfdzvphieejw9/RegisterRExt.log?dl=0 – Frank Nov 20 '15 at 01:17
  • Thanks for sharing the logs. The problem was with registration of R Extension (RegisterRExt) with the correct SQL Server instance. Based on the logs, it appears the instance name is 'MSSQLSERVER2016'. Please follow instructions in my other answer and let me know if this fixes your issue. – Arun Gurunathan Nov 20 '15 at 18:41
0

For SQL Server 2016 official RTM release I've found that a similar error (but with "incorrect parameter" instead of "Element not found") was caused because I moved the working directory in the R config file to have directory without spaces, but you need also to create inside it other working directories, from SQL201601 to SQL201620, as it was in the original confi directory.

Regards Massimo

massimogentilini
  • 4,102
  • 5
  • 29
  • 32