rxPredict throws SQL Server does not exist or access denied error RRS feed

  • Question

  • Hi everyone,

    I am trying out the SQL Server R services tutorial on MSDN - link below:


    When I run the rxPredict command:

    rxPredict(modelObject = logitObj, data = featureDataSource, outData = scoredOutput,  
              predVarNames = "Score", type = "response",  
              writeModelVars = TRUE, overwrite = TRUE) 

    I get the following error:

    ======  SG01NB-4300092  ( process  1 ) has started run at  2016-07-04 09:43:35.00  ====== 
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. 
    Caught exception in file: CxAnalysis.cpp, line: 5682. ThreadID: 13560 Rethrowing. 
    Caught exception in file: CxAnalysis.cpp, line: 5249. ThreadID: 13560 Rethrowing. 
    [Microsoft][ODBC Driver Manager] Connection not open 
    ODBC Error in SQLDisconnect 
    Error in doTryCatch(return(expr), name, parentenv, handler) : 
      [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. 
    Calls: source ... tryCatch -> tryCatchList -> tryCatchOne -> doTryCatch -> .Call 
    Execution halted 
    Error in rxCompleteClusterJob(hpcServerJob, consoleOutput, autoCleanup) : 
      No results available - final job state: failed

    I have made sure that my rxSetComputeContext(cc) is using a valid user login that can create tables. I am also installing SQL Server on the local machine I am working on so it cannot be a network issue.

    Has anyone encountered this issue and manage to run this statement successfully?

    Thanks for any replies and help!


    Monday, July 4, 2016 1:57 AM

All replies

  • Hi everyone,

    I found that the problem lies with outData = scoredOutput statement. If I set the outData=NULL and change the server context to local, I am able to generate an output from rxPredict.

    What I decided was to then execute the rxPredict with the rxSetComputeContext("local") get the output data frame (outDF) and then save it back to the SQL Server using rxDataStep(inData = outDF, outFile = scoredOutput, overwrite=TRUE)

    If anyone has a better approach please let me know!



    • Proposed as answer by fintangillane Saturday, January 7, 2017 8:37 AM
    Monday, July 4, 2016 6:12 AM
  • Please make sure you have provided the worker/Launchpad accounts (used for running the R scripts) permissions to login to SQL Server on your behalf. See Enable Implied Authentication for Launchpad Accounts for more details.
    Wednesday, July 13, 2016 7:34 PM
  • I have same problem - actually number of Revo and MS tutorial do not run on SQL server context (on local context it's perfectly fine).

    I understand those accounts need to be added manually? It is not done during SQL/R installation?



    Sunday, February 12, 2017 9:00 PM