Skip to content Skip to sidebar Skip to footer

Not Able To Execute Sql Command Through A Session Created Using Popen In Python

I'm trying to connect to SQL server using the below code I'm getting error invalid argument. I'm trying to read from a sql file and the run the query on the session created by pope

Solution 1:

try this (add shell=True):

session = Popen(connection_string, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True)

or you can you can add explicit path of sqlcmd.exe to your string ...

Post a Comment for "Not Able To Execute Sql Command Through A Session Created Using Popen In Python"