I need to be able to tell if SQL queries kicked off by Python have failed. So far I have:
import subprocess
p = subprocess.Popen(['sqlcmd', '-E -m-1 -S 1070854A\AISP -i NewStructures.sql >>process.log'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
print out
print err
But it is not liking the SQLCMD parameters. Output says
Sqlcmd: '-E -S 1070854A\AISP -i NewStructures.sql': Unknown Option. Enter '-?' for help.
These parameters work when typing them into the command line.
Thanks.