EXECUTE语句失败,因为其WITH RESULT SETS子句指定了1个结果集

时间:2018-02-08 14:27:22

标签: r sql-server-2016

我试图在SQL Server 2016中运行一个简单的R代码:

    EXEC sp_execute_external_script
   @language =N'R',
    @script=N'OutputDataSet<-InputDataSet',
    @input_data_1 =N'SELECT 1 AS hello'
    WITH RESULT SETS (([hello] int not null));
   GO

我已按照此链接配置:https://tomaztsql.wordpress.com/2016/07/26/enabling-sp_execute_external_script-to-run-r-scripts-in-sql-server-2016/

我收到错误:

    Msg 39023, Level 16, State 1, Procedure sp_execute_external_script, 
     Line 1 [Batch Start Line 0]
     'sp_execute_external_script' is disabled on this instance of SQL 
  Server. Use sp_configure 'external scripts enabled' to enable it.
  Msg 11536, Level 16, State 1, Line 1
 EXECUTE statement failed because its WITH RESULT SETS clause specified 1 
  result set(s), but the statement only sent 0 result set(s) at run time.

     when I checked with :

  EXECUTE sp_configure;
  GO
  The result shows like this:
  name                    minimum         maximum        config_value      run_value
  external scripts enabled  0          1                1                0

为什么运行值仍为0(注意 - 我重新启动了SQL Server Launchpad)?这是什么决议?

1 个答案:

答案 0 :(得分:0)

问题已解决。需要重启SQL Server服务。哪个会重启一切。它的工作正常。