title: MSSQL2008 - Pyodbc - Previous SQL was not a query
body: <p>I can't figure out what's wrong with the following code,
  The syntax IS ok (checked with SQL Management Studio), i have access as i should so that works too.. but for some reason as soon as i try to create a table via PyODBC then it stops working.</p>
  
  <pre><code>import pyodbc
  
  def SQL(QUERY, target = '...', DB = '...'):
      cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=' + target + DB+';UID=user;PWD=pass')
      cursor = cnxn.cursor()
      cursor.execute(QUERY)
      cpn = []
  
      for row in cursor:
          cpn.append(row)
      return cpn
  
  print SQL("CREATE TABLE dbo.Approvals (ID SMALLINT NOT NULL IDENTITY PRIMARY KEY, HostName char(120));")
  </code></pre>
  
  <p>It fails with:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test_sql.py", line 25, in &lt;module&gt;
      print SQL("CREATE TABLE dbo.Approvals (ID SMALLINT NOT NULL IDENTITY PRIMARY KEY, HostName char(120));")
    File "test_sql.py", line 20, in SQL
      for row in cursor:
  pyodbc.ProgrammingError: No results.  Previous SQL was not a query.
  </code></pre>
  
  <p>Anyone have any idea to why this is?
  I got a "SQL Server" driver installed (it's default), running Windows 7 against a Windows 2008 SQL Server environment (Not a express database).</p>