0

I've created a model in R, published into SQL Server table and validated the model by calling it into SQL Server. However, I am failing to execute model stored procedure in SQL server.

I get this error message:

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

Error 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

Tried this;

model <- unserialize(rx_model); 

or

model <- unserialize(as.raw(rx_model));

also tried;

model = unserialize(rx_model);

Still getting same error.

New to R/ML in SQL Server, help would be appreciated

adey27
  • 439
  • 3
  • 19
  • What command triggered the error? – r2evans May 19 '22 at 13:42
  • I used above commands to "unserialize" before using the model.m ie, First tried this: model <- unserialize(rx_model);. then again, model <- unserialize(as.raw(rx_model));. both are giving same errors – adey27 May 19 '22 at 23:49

0 Answers0