2016-10-10 96 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的登錄。

相關問題