繁体   English   中英

SQL 作业在 Powershell 脚本中调用 Python 失败

[英]SQL Job Fails on Python call in Powershell Script

我有一个 powershell 脚本,我想将其作为 SQL 代理作业运行。

它包含 3 行:

调用-SqlCmd... 复制-项目... python...

前两行完美无缺,但是第三行的工作失败了,我称之为 python。

从 powershell ISE 手动运行时,powershell 脚本工作正常。 我假设,这似乎是从一些谷歌搜索来看 SQL 代理不喜欢或不能单独运行 python 的情况,但是我会假设因为它的所有部分都是 Z2F2D399F0EA3B 周围的 084853Z 脚本 I54问题。

SQL 作业错误是:

Executed as user: DOMAIN\SQL_ReportServer. A job step received an error at line 3 in a PowerShell script. The corresponding line is 'python StripQuotes.py "E:\DW_Exports\Pearsonvue\CDD.txt"'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.  '.  Process Exit Code -1.  The step failed.

反正有没有让这个过程工作?

术语“python”未被识别为 cmdlet、function、脚本文件或可运行程序的名称。

python在 SQL 服务器代理或 powershell 代理帐户的上下文中不可见。 尝试使用完全限定的路径名(例如C:\Python37\python.exe )调用 python 。 您可能会遇到更多错误,然后应将其作为新的单独问题进行调试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM