SQL SERVER 2016 R Services -- SQL Server does not exist or access denied

1

I was trying to learn the new feature -- R in SQL Server 2016 and I was following this link as example.

I set up SQLRUserGroup as a new login and was able to run some R scripts, but the data_preprocess_score.sql gives me the following error message and it looked like related to connection.

Here is what I tried to call the sproc:

EXEC data_preprocess_score @testlength = 1, @id1value = 2, @id2value = 1,
    @connectionString = 'SERVER=.;DATABASE=Test;Trusted_Connection=true;`'

Below is the error message:

Msg 39004, Level 16, State 20, Line 1
A 'R' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004.
Msg 39019, Level 16, State 1, Line 1

An external script error occurred:

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
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
In addition: Warning message:
In Ops.factor(tsvalues, value.threshold) : '>' not meaningful for factors

Error in ScaleR.  Check the output for more information.
Error in eval(expr, envir, enclos) : 
Error in ScaleR.  Check the output for more information.
Calls: source -> withVisible -> eval -> eval -> .Call
Execution halted

STDOUT message(s) from external script:

Rows Read: 166, Total Rows Processed: 166Caught exception in file: CxAnalysis.cpp, line: 6488. ThreadID: 14112 Rethrowing.

[Microsoft][ODBC Driver Manager] Connection not open

ODBC Error in SQLDisconnect
Caught exception in file: CxAnalysis.cpp, line: 5682. ThreadID: 14112 Rethrowing.
Caught exception in file: CxAnalysis.cpp, line: 5249. ThreadID: 14112 Rethrowing.

Can someone help me with this error? Thanks!

sql
r
database-connection
sql-server-2016
asked on Stack Overflow Oct 10, 2016 by Chengzhi • edited Oct 11, 2016 by r2evans

2 Answers

0

Add Driver=SQL Server to the front of your connection string. It wouldn't hurt to set Server=localhost too.

EXEC data_preprocess_score @testlength = 1, @id1value = 2, @id2value = 1,
    @connectionString = 'Driver=SQL Server;SERVER=localhost;DATABASE=Test;Trusted_Connection=true;'
answered on Stack Overflow Oct 11, 2016 by Hong Ooi
0

If you are able to run R scripts to get data, but get the following error with when writing data with rx functions like rxPredict/rxDataStep:

DBNETLIB; SQL Server does not exist or access denied

Then, you may be hitting an issue with loop back connections to SQL Server from R script. Please check the following configurations required for loop back connections:

  1. Implied Authentication for Launchpad Accounts is enabled using instructions here

  2. TCP/IP client protocol is enabled for the Server using instructions here

Specifically in your case, please check for the TCP/IP protocol configuration, since you mentioned the login for SQLRUserGroup was created.

answered on Stack Overflow Oct 11, 2016 by Arun Gurunathan • edited Oct 11, 2016 by Arun Gurunathan

User contributions licensed under CC BY-SA 3.0