I'm having trouble executing a SQL Server stored procedure with Python 3.4. I'm importing Pyodbc to create the connection and have a few lines that are supposed to sent data to a stored procedure.
My Python:
sql = "exec <stored_procedure_name> @int1=?, @int2=?, @string1=?, @int3=?"
params = (irow[0], irow[15], irow[2], irow[6])
cursor.execute(sql, params)
Stored Procedure:
@int1 int,
@int2 int,
@string1 varchar(10),
@int3 int
AS
BEGIN
--Do stuff
END
I'm not getting an errors in Command Prompt when I execute the script. When I print
print(sql, params)
I get a weird looking result. Nothing is inserted into the table that is being targeted in the stored procedure.
exec <stored_procedure_name> @int1=?, @int2=?, @string1=?, @int3=? (0, 0, 'string', 0)
I'm new to Python so any insight would be greatly appreciated. Nothing I've seen on SO has helped.