Sql server 在R中调用季节性包的Sql Server存储过程

Sql server 在R中调用季节性包的Sql Server存储过程,sql-server,r,stored-procedures,Sql Server,R,Stored Procedures,我已经使用R函数编写了SQL server存储过程。SQLServerManagementStudio中的所有工作都没有问题,只有一个例外 我想使用季节性软件包,但是SQLServerManagementStudio中的代码失败了。同样的代码在R(C:\Program Files\Microsoft SQL Server\MSSQL13.SQLEXPRESS\R\u SERVICES\bin)中工作得非常好 (我在这里包括了X13_路径,因为它是sql server R工作所必需的—从我的桌面R

我已经使用R函数编写了SQL server存储过程。SQLServerManagementStudio中的所有工作都没有问题,只有一个例外

我想使用季节性软件包,但是SQLServerManagementStudio中的代码失败了。同样的代码在R(C:\Program Files\Microsoft SQL Server\MSSQL13.SQLEXPRESS\R\u SERVICES\bin)中工作得非常好

(我在这里包括了X13_路径,因为它是sql server R工作所必需的—从我的桌面R运行时不需要它)

显示的错误消息为:

STDERR message(s) from external script: 
Loading required package: seasonal
X-13 installation test:
  - X13_PATH correctly specified
  - binary executable file found
  - command line test run successful
  - command line test produced HTML output

Error : seasonal test run failed, with the message:
Error : X-13 has run but produced no data

Error details:
  - X13_PATH:         C:/Program Files/Microsoft SQL Server/MSSQL13.SQLEXPRESS/R_SERVICES/library/x13binary/bin
  - Full binary path: "C:/Program Files/Microsoft SQL Server/MSSQL13.SQLEXPRESS/R_SERVICES/library/x13binary/bin/x13ashtml.exe"
  - Platform:         x86_64-w64-mingw32
  - R-Version:        R version 3.2.2 (2015-08-14)
  - seasonal-Version: 1.1.0
从sql目录中的R运行的代码返回的结果完全相同:

X-13 installation test:
  - X13_PATH correctly specified
  - binary executable file found
  - command line test run successful
  - command line test produced HTML output
   - seasonal test run successful
Congratulations! 'seasonal' should work fine!
我授予了这些文件夹的完全控制权限(对于R,对于R库文件夹,对于x13二进制文件夹),希望这能解决问题,但仍然失败


关于如何解决这个问题,您有什么想法吗?

答案已在上面的评论中提交。

根本原因:通过在sqlserver中执行外部R脚本创建为临时文件的数据文件的名称很长。此路径在x13ashtml.exe进程读取的.spc文件中指定,该文件将数据文件名的限制设置为133。创建指向ExtensibilityData文件夹mklink/d c:\ExtensibilityData-“c:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\ExtensibilityData”的符号链接例如,mklink/d c:\extensibilitydata-MSSQL13.MSSQLSERVER“c:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\extensibilitydata”编辑c:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\rlauncher.config,将工作目录设置为新创建的符号链接。e、 g.WORKING_DIRECTORY=C:\extensibilitydata-MSSQL13.mssqlserver重新启动Sql Server启动板服务。在提升的命令提示符execute:net stop mssqllaunchpad&net start mssqllaunchpad中,您应该将答案放入您的答案中。评论不一定会留下来。
X-13 installation test:
  - X13_PATH correctly specified
  - binary executable file found
  - command line test run successful
  - command line test produced HTML output
   - seasonal test run successful
Congratulations! 'seasonal' should work fine!