title: SQL query with Python doesn't work
body: <p>I wrote this code to delete duplicates from a table.
  It works fine when executed in Microsoft SQL Server Management Studio 
  but I can't get it to work executing with Python.</p>
  
  <p>There is no error occuring, it's just not working ...
  I tried executing other queries aswell without any problems.</p>
  
  <p>Someone an idea what could be wrong ?
  I'm using Python 2.7</p>
  
  <pre><code>import pymssql    
  import time
  
  conn = pymssql.connect(server='rfhete755', database='EEX')
  
  c = conn.cursor()
  
  p = """
      SELECT [ID]
          ,[Operator]
          ,[Source]
          ,[Timestamp]
          ,ROW_NUMBER() OVER (
              PARTITION BY [Operator]
              ,[Source]
              ,[Timestamp] ORDER BY [Timestamp]
              ) AS Rnum
      FROM [EEX].[dbo].[Wind_Solar];
  
      WITH CTE
      AS (
          SELECT [Operator]
              ,[Source]
              ,[Timestamp]
              ,ROW_NUMBER() OVER (
                  PARTITION BY [Operator]
                  ,[Source]
                  ,[Timestamp] ORDER BY [Timestamp]
                  ) AS Rnum
          FROM [EEX].[dbo].[Wind_Solar]
          )
      DELETE
      FROM CTE
      WHERE Rnum &lt;&gt; 1"""
  
  print p
  
  c.execute(p)
  
  time.sleep(2)
  
  conn.commit()
  
  time.sleep(1)
  
  c.close()
  conn.close()
  </code></pre>