your text`I’m trying to execute a stored procedure in SQL server from python using pyobdc. apparently it is working correctly but there is nothing being executed in my database. When I execute that procedure directly in SQL server everything workd correctly. here is my code hope you can help me.
connectors = [
SQLServerConnector(
driver=”{SQL Server Native Client 11.0}”,
server=r”MARIOSQLMARIO”,
database=”SlicTe”
)
]
try:
result = []
# Connect to the database
first_connector = connectors[0]
connection = first_connector.connect()
cursor = connection.cursor()
wExe = f'''EXEC SlicTe.dbo.Produccion {folio}'''
# Execute the SQL command
cursor.execute(wExe)
connection.commit()
# Close the cursor and connection
cursor.close()
connection.close()
except Exception as e:
titulo = "Error en aplicación"
mensaje = f"Error: {str(e)}"
print(mensaje) # Debug print
messagebox.showerror(titulo, mensaje)
I have tried everything but nothing works
Mario Márquez Segovia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2