我正在尝试学习新功能 - 在SQL Server 2016中使用R,而我正在关注此link作为示例。
我将SQLRUserGroup设置为新的登录名并且能够运行一些R脚本,但data_preprocess_score.sql给出了以下错误消息,它看起来与连接有关。
以下是我试图称之为sproc的内容:
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消息:
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 :(得分: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;'
答案 1 :(得分:0)