2016-10-10 48 views
1

我正试图学习SQL Server 2016中的新功能 - R,并以此link为例。SQL SERVER 2016 R服务 - SQL Server不存在或访问被拒绝

我将SQLRUserGroup设置为新的登录名并且能够运行一些R脚本,但是data_preprocess_score.sql给了我下面的错误消息,它看起来像连接。

这是我试着拨打存储过程:

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

以下是错误消息:发生

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 

外部脚本错误:

[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消息( s)来自外部脚本:

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. 

有人可以帮我解决这个错误吗? 谢谢!

+0

尝试使用'(local)'或'localhost'代替'SERVER ='参数的句号 – cha

+0

谢谢@cha,我试过了,但它仍然给了我同样的错误信息。 – Chengzhi

回答

0

Driver=SQL Server添加到连接字符串的前面。设置Server=localhost也不会造成伤害。

EXEC data_preprocess_score @testlength = 1, @id1value = 2, @id2value = 1, 
    @connectionString = 'Driver=SQL Server;SERVER=localhost;DATABASE=Test;Trusted_Connection=true;' 
0

如果你能够运行[R脚本来获取数据,但得到编写与RX功能,如rxPredict/rxDataStep数据时,出现以下错误:

DBNETLIB; SQL Server不存在或访问被拒绝

然后,您可能会遇到从R脚本到SQL Server的环回连接问题。请检查回环连接所需的以下配置:

  1. 用于快速启动帐户隐含认证使用说明here

  2. TCP/IP客户端协议为服务器启用了使用说明here

启用

特别是对于你的情况,请检查TCP/IP协议配置,因为你提到了创建SQLRUserGroup的登录。

相关问题