executing external scripts in sql

2

I am just trying to write codes in R-Script in SQL but I am getting this error. Can anyone please help

execute sp_execute_external_script 
@language = N'R',
@script = N'
 
install.packages("rvest")
library(rvest)
authorshtml <- read_html("https://www.mssqltips.com/sql-server-mssqltips-authors/")
authors <- authorshtml %>% html_nodes("div .large-7") %>% html_nodes("a") %>% html_text() 
OutputDataSet <- data.frame(authors)
 
'
with result sets ((Authors varchar(max)))

but I get this error nd cant seem to figure it out.

Msg 39004, Level 16, State 20, Line 0
A 'R' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004.
Msg 39019, Level 16, State 2, Line 0
An external script error occurred: 
Error in eval(ei, envir) : object 'N' not found
Calls: source -> withVisible -> eval -> eval

Error in execution.  Check the output for more information.
Error in eval(ei, envir) : 
  Error in execution.  Check the output for more information.
Calls: runScriptFile -> source -> withVisible -> eval -> eval -> .Call
Execution halted
sql
r
asked on Stack Overflow Apr 22, 2021 by Ted Fam • edited Apr 22, 2021 by r2evans

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0