【发布时间】:2019-10-06 00:29:36
【问题描述】:
我已经执行了以下命令:
EXEC sp_configure 'external scripts enabled', 1
RECONFIGURE WITH OVERRIDE
从消息看来一切顺利:
Configuration option 'external scripts enabled' changed from 1 to 1. Run the RECONFIGURE statement to install.
但是,当执行下面的脚本时,它显示错误:
exec sp_execute_external_script
@language =N'Python',
@script=N'OutputDataSet = InputDataSet
print("Input data is {0}".format(InputDataSet))',
@input_data_1 = N'SELECT 1 as col'
错误:
Msg 39023, Level 16, State 1, Procedure sp_execute_external_script, Line 1 [Batch Start Line 7]
'sp_execute_external_script' is disabled on this instance of SQL Server. Use sp_configure 'external scripts enabled' to enable it.
当我执行时:exec sp_configure
它显示“启用外部脚本”run_value 为 0
当我通过运行更新查询来更新“运行值”时:
update sys.configurations set value_in_use = 1
where name like 'external scripts enabled'
得到错误:
Ad hoc updates to system catalogs are not allowed.
这是系统详细信息(来自 SSMS 帮助 -> 关于):
SQL Server Management Studio 15.0.18118.0
Microsoft Analysis Services Client Tools 15.0.1300.131
Microsoft Data Access Components (MDAC) 10.0.17134.1
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.11.17134.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 6.3.17134
Microsoft SQL Server 2017 (RTM-CU14) (KB4484710) - 14.0.3076.1 (X64)
Mar 12 2019 19:29:19
Copyright (C) 2017 Microsoft Corporation
Developer Edition (64-bit) on Windows 10 Home 10.0 <X64> (Build 17134: )
另外,尝试从此处 (https://www.microsoft.com/en-us/download/details.aspx?id=56128) 安装 SQL Server 最新更新。
Python 安装失败。
如何解决此问题并在 SQL Server 2017 上运行 python?我需要安装任何 SQL Server 服务包吗?请建议。 谢谢。
【问题讨论】:
-
那不是你的SQL Server版本,那是SSMS的版本;这是完全无关的。使用
PRINT @@VERSION;获取您的 SQL Server 版本。 -
用 SQL 版本更新了我的问题。
标签: python sql-server sql-server-2017