Is parameter binding implemented correctly in pymssql library?
问题 I'm calling extremely simple query from Python program using pymsqsql library. with self.conn.cursor() as cursor: cursor.execute('select extra_id from mytable where id = %d', id) extra_id = cursor.fetchone()[0] Note that parameter binding is used as described in pymssql documentation. One of the main goals of parameter binding is providing ability for DBMS engine to cache the query plan. I connected to MS SQL with Profiler and checked what queries are actually executed. It turned out that