title: pypyodbc cursor.execute() List index out of range
body: <p>It's late, I'm tired - I hope I am just making a stupid mistake but I can't seem to see it. Can anyone see what I may be doing wrong? If I run the SQL on SQL Server Management studio, it works fine. I can run other SQL statements against the cursor, just not this one.</p>
  
  <p>Thanks in advance</p>
  
  <p>System:<br/></p>
  
  <pre><code>Windows 7, Python 3.4, SQLServer 2008, pypyodbc
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>IF EXISTS(SELECT * FROM sys.databases WHERE name='{MyDBName}')
  BEGIN
   ALTER DATABASE {MyDBName} SET SINGLE_USER WITH ROLLBACK IMMEDIATE; 
   DROP DATABASE {MyDBName}; 
  END
  </code></pre>
  
  <p>CODE:</p>
  
  <pre><code>cursor.execute(query)
  cursor.commit()
  </code></pre>
  
  <p>EXCEPTION:</p>
  
  <pre><code>ex = {IndexError} list index out of range
  </code></pre>