pymssql get SQL command - last_executed
<p>I have a python script what isnert data to a MS SQL databse. Part of my code:</p>

<pre><code>cursor.execute("INSERT INTO TABLE (COL1, COL2, COL3) VALUES (%s,%s,%s)", (a,b,c))
</code></pre>

<p>The a, b and c are variables.
I want to print executed SQL command. Is this possible?</p>

<p>My goal is log/print every executed SQL command e.g.:</p>

<pre><code>INSERT INTO TABLE (COL1, COL2, COL3) VALUES ('Lemon','Apple','Orange')
</code></pre>

<p>Like a _last_executed attribute on pymysql cursor.</p>

<p>Thanks!</p>

<p>You can try</p>

<pre><code>print ("INSERT INTO TABLE (COL1, COL2, COL3) VALUES (%s,%s,%s)", (a,b,c))
</code></pre>

python insert pymssql