我有一个python脚本,它使用子进程运行一些sql脚本。
branch_path = "C:/devel/branch" #path used in command
command_process = subprocess.Popen(
['sqlcmd', '-E', '-V1', '-S', 'MYPC', '-i', branch_path +"/DatabaseScripts/restore_db_mss.sql"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True
)
command_output = command_process.communicate()[0]
print command_output
我收到此错误:
Sqlcmd: Error: Error occurred while opening or operating on file C: (Reason: Access is denied).
我尝试给我的机器正确的权限,但没有任何效果。我尝试按照其他人的建议切换到管理服务,但这也不起作用。任何帮助将不胜感激