I need to call a SqlServer stored procedure
from python2.7
via pyodbc
module with input parameter name.
I tried based on documentation by input parameter order:
cursor.execute('{CALL [SP_NAME](?,?)}',
('value', 'value'))
It works, but I need to pass parameter name of stored procedure
because order of stored procedure input parameter always changes. So I need to pass them by name.
cursor.execute('{CALL [SP_NAME](@param1name,@param2name)}',
('value', 'value'))
However this doesn't work. What's the correct syntax?
See Question&Answers more detail:os