I have a python script that runs a few sql scripts using subprocesses.
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
I get this error:
Sqlcmd: Error: Error occurred while opening or operating on file C: (Reason: Access is denied).
I tried giving my machine the correct permissions but nothing worked. I tried swtching to the service to admin as suggested by others but that is not working either. Any help would be much appreciated