title: to_sql pandas data frame into SQL server error: DatabaseError
body: <p>While trying to write a <code>pandas</code>' dataframe into <code>sql-server</code>, I get this error:</p>
  
  <blockquote>
    <p>DatabaseError: Execution failed on sql 'SELECT name FROM sqlite_master WHERE type='table' AND name=?;': ('42S02', "[42S02] [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'sqlite_master'. (208) (SQLExecDirectW); [42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared. (8180)")</p>
  </blockquote>
  
  <p>It seems <code>pandas</code> is looking into <code>sqlite</code> instead of the real database.</p>
  
  <p>It's not a connection problem since I can read from the <code>sql-server</code> with the same connection using <code>pandas.read_sql</code> 
  The connection has been set using </p>
  
  <pre><code>sqlalchemy.create_engine("mssql+pyodbc:///?odbc_connect=%s" % params)
  </code></pre>
  
  <p>It's not a database permission problem either since I can write line by line using the same connection parameters as:</p>
  
  <pre><code>cursor = conn.cursor()
  cursor.execute('insert into test values (1, 'test', 10)')
  conn.commit()
  </code></pre>
  
  <p>I could just write a loop to instert line by line but I would like to know why <code>to_sql</code> isn't working for me, and I am affraid it won't be as efficient.</p>
  
  <p>Environment:
  <code>Python</code>: 2.7
  <code>Pandas</code>: 0.20.1
  <code>sqlalchemy</code>: 1.1.12</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>runnable example</strong>:</p>
  
  <pre><code>import pandas as pd
  from sqlalchemy import create_engine
  import urllib
  
  params = urllib.quote_plus("DRIVER={SQL Server Native Client 11.0};SERVER=
  &lt;servername&gt;;DATABASE=&lt;databasename&gt;;UID=&lt;username&gt;;PWD=&lt;password&gt;")
  engine = create_engine("mssql+pyodbc:///?odbc_connect=%s" % params)
  
  test = pd.DataFrame({'col1':1, 'col2':'test', 'col3':10}, index=[0])
  conn=engine.connect().connection
  test.to_sql("dbo.test", con=conn, if_exists="append", index=False)
  </code></pre>