首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SQL作业在Powershell脚本中的Python调用中失败

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

Stack Overflow用户
提问于 2020-04-14 17:54:09
回答 1查看 248关注 0票数 0

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

它包含3行:

调用-SqlCmd.复印物品..。python..。

前2行工作完美,但是在第三行(我称之为python )上,作业失败了。

当从powershell ISE手动运行时,powershell脚本工作良好。我认为,这似乎是某些googling中的情况,SQL Agent不喜欢或者不能单独运行python,但是我认为,由于它是powershell脚本的所有部分,所以我会解决这个问题。

SQL作业错误是:

代码语言:javascript
复制
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.

有办法让这个过程起作用吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-04-14 19:08:20

术语'python‘不被识别为cmdlet、函数、脚本文件或可操作程序的名称。

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61214087

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档