I am trying to run an Stored Proc in SQL Server (Synapse) using pyodbc
.This SP merely performs INSERT
operation into a table.
sql =""" EXEC my_sp (?,?,?)"""
values = (str(v1),str(v2),int(v3))
cur.execute(sql,(values))
conn.commit()
This above code is not giving any error. But when I am querying the Table, I don't see the records. However, when I am running above SP in SSMS console, this works fine.
Can't figure out why this is so?
Any clue?
conn = pyodbc.connect( … , autocommit=True)
and commenting out theconn.commit()
– Izakautocommit=True
. However, output variable is being returned or if there is any select query. it seems only one statement is being executed. – Responsible