I need to use JSON data as source for my SSRS report. Before that I wanted to convert the data so i followed below steps , post that also I am getting error.
I am using SQL Server 2017
Sample Code:
EXEC sp_execute_external_script
@language = N'R'
,@script = N'library(jsonlite)
mydata <- fromJSON("https://jsonplaceholder.typicode.com/posts" rel="nofollow")'
, @output_data_1_name = N'mydata'
WITH RESULT SETS ((userId int ,Id int , title varchar(max),body varchar(max)))
Error:
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 open.connection(con, "rb") : Couldn't connect to server
Calls: source ... fromJSON_string -> parseJSON -> parse_con -> open -> open.connectionError in execution. Check the output for more information.
Error in eval(expr, envir, enclos) :
Error in execution. Check the output for more information.
Calls: source -> withVisible -> eval -> eval -> .Call Execution halted
User contributions licensed under CC BY-SA 3.0