我正在尝试在 2016 年执行一个名为 sp_execute_external_script 的新存储过程。我首先需要按如下方式启用外部脚本:
sp_configure 'external scripts enabled', 1;
Run Code Online (Sandbox Code Playgroud)
执行此操作后,我看到此消息:
Configuration option 'external scripts enabled' changed from 1 to 1. Run the RECONFIGURE statement to install.
Run Code Online (Sandbox Code Playgroud)
然后我执行RECONFIGURE
并看到一条消息说,"Command(s) completed successfully"
。
然后我尝试执行以下操作,以查看 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
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我看到以下错误:
Msg 39023, Level 16, State 1, Procedure sp_execute_external_script, Line 1 [Batch Start Line 3]
'sp_execute_external_script' is disabled on this instance of SQL Server. Use sp_configure 'external scripts enabled' to enable it.
Run Code Online (Sandbox Code Playgroud)
任何想法为什么?
打开外部脚本后,您需要重新启动 SQL Server,以便在运行时
sp_configure 'external scripts enabled';
Run Code Online (Sandbox Code Playgroud)
它返回 1 的 run_value:
name minimum maximum config_value run_value
----------------------------------- ----------- ----------- ------------ -----------
external scripts enabled 0 1 1 1
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2027 次 |
最近记录: |