我有一个powershell脚本,我想作为SQL代理作业运行它。
它包含3行:
调用-SqlCmd.复印物品..。python..。
前2行工作完美,但是在第三行(我称之为python )上,作业失败了。
当从powershell ISE手动运行时,powershell脚本工作良好。我认为,这似乎是某些googling中的情况,SQL Agent不喜欢或者不能单独运行python,但是我认为,由于它是powershell脚本的所有部分,所以我会解决这个问题。
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.有办法让这个过程起作用吗?
发布于 2020-04-14 19:08:20
术语'python‘不被识别为cmdlet、函数、脚本文件或可操作程序的名称。
python在Server代理或powershell代理帐户上下文的路径中不可见。尝试使用完全限定的路径名(例如C:\Python37\python.exe)调用python。您可能会遇到进一步的错误,然后您应该将其调试为新的和单独的问题。
https://stackoverflow.com/questions/61214087
复制相似问题