none
Setting the Compute Context to SQL Server 2016 gives ODBC error RRS feed

  • Question

  • I am writing some R code in VS using the MRO-For-RRE engine to analyze data on SQL Server 2106 RC3, and can successfully connect to the data and run rxGetVarInfo to look at the data returned.  I have a lot of data and need to change my compute context to run on the server rather than run locally.

    This is how I am setting my compute context

    # Set ComputeContext.
    sqlShareDir <- paste("C:\\AllShare\\", Sys.getenv("USERNAME"), sep = "")
    sqlWait <- TRUE
    sqlConsoleOutput <- FALSE
    runonServer <- RxInSqlServer(connectionString = connStr, shareDir = sqlShareDir,
                        wait = sqlWait, consoleOutput = sqlConsoleOutput)
    rxSetComputeContext(runonServer)


    than No errors are received when I run this code.  I go and get data and run rxHistogram

    OverallCategory <- "SELECT overall  FROM dbo.Amazon"

    sdOverallCat <- RxSqlServerData(sqlQuery = OverallCategory, connectionString = connStr,
                                    colClasses = c(overall = "numeric")
                                  ,  rowsPerRead = 500)
                                 
    rxImport(inDataSource)      
    rxHistogram( ~overall, data = inDataSource, title = "Review Ratings Histogram" )

    at this point I receive an error

    [Microsoft][ODBC Driver Manager] Function sequence error

    I was using a read only id, I changed that to an ID with DBO rights.  That change resulted in the ODBC error that I pasted above.  I was getting a different ODBC error.

    If I change my compute context to run locally


    rxSetComputeContext("local")

    I have no errors, and everything works fine.  I don't want to run locally, I want to run on the server.  What do I need to do to resolve this error?





    Monday, June 6, 2016 3:15 PM

Answers

  • Resolved the issue.  It turns out this is a driver issue.  SQL Server 2016 uses MRE 8.0.3 and the client tools I had installed were 8.0.0.  Since I was on the same box, I installed the stand alone version of R Server from the SQL Server 2016 Installation Center to resolve the issue.  All of my ODBC errors went away.
    • Marked as answer by desertislesql Tuesday, June 7, 2016 1:31 PM
    Tuesday, June 7, 2016 1:31 PM

All replies

  • Hi, can you share the output of the following command from your client machine and SQL server machines?

    c:\>rterm.exe --slave -e "Revo.version"

    What was the error you were getting previously? The script you have listed above seems to be missing some parts - like I don't see where "inDataSource" is created. I also don't understand why you need to do rxImport(inDataSource).

    You can add "traceEnabled=TRUE, traceLevel=7" also to your RxInSqlServer(...) constructor to give you more detailed error feedback if any.

    Tuesday, June 7, 2016 12:06 AM
  • Resolved the issue.  It turns out this is a driver issue.  SQL Server 2016 uses MRE 8.0.3 and the client tools I had installed were 8.0.0.  Since I was on the same box, I installed the stand alone version of R Server from the SQL Server 2016 Installation Center to resolve the issue.  All of my ODBC errors went away.
    • Marked as answer by desertislesql Tuesday, June 7, 2016 1:31 PM
    Tuesday, June 7, 2016 1:31 PM
  • Could you share the connection strings to run it on the R Server standalone?

    We have installed it but there is absolutely NO Documentation available.

    Wednesday, October 5, 2016 4:18 PM