"No driver name specified" writing pandas data frame into SQL Server table
<p>I am trying to write a Pandas' DataFrame into an SQL Server table. Here is my example:</p>

<pre><code>import pyodbc
import pandas as pd
import sqlalchemy

df = pd.DataFrame({'MDN': [242342342] })
engine = sqlalchemy.create_engine('mssql://localhost/Sandbox?trusted_connection=yes')
df.to_sql('Test',engine, if_exists = 'append',index = False)
</code></pre>

<p>I am getting the following error message. Any thoughts on how to fix?</p>

<pre><code>c:\python34\lib\site-packages\sqlalchemy\connectors\pyodbc.py:82: SAWarning: No driver name specified; this is expected by PyODBC when using DSN-less connections
  "No driver name specified; "


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
&lt;ipython-input-25-78677a18ce2d&gt; in &lt;module&gt;()
      4 engine = sqlalchemy.create_engine('mssql://localhost/Sandbox?trusted_connection=yes')
      5 
----&gt; 6 df.to_sql('Test',engine, if_exists = 'append',index = False)
      7 
      8 #cnxn.close()

c:\python34\lib\site-packages\pandas\core\generic.py in to_sql(self, name, con, flavor, schema, if_exists, index, index_label, chunksize, dtype)
    980             self, name, con, flavor=flavor, schema=schema, if_exists=if_exists,
    981             index=index, index_label=index_label, chunksize=chunksize,
--&gt; 982             dtype=dtype)
    983 
    984     def to_pickle(self, path):

c:\python34\lib\site-packages\pandas\io\sql.py in to_sql(frame, name, con, flavor, schema, if_exists, index, index_label, chunksize, dtype)
    547     pandas_sql.to_sql(frame, name, if_exists=if_exists, index=index,
    548                       index_label=index_label, schema=schema,
--&gt; 549                       chunksize=chunksize, dtype=dtype)
    550 
    551 

c:\python34\lib\site-packages\pandas\io\sql.py in to_sql(self, frame, name, if_exists, index, index_label, schema, chunksize, dtype)
   1564                             if_exists=if_exists, index_label=index_label,
   1565                             dtype=dtype)
-&gt; 1566         table.create()
   1567         table.insert(chunksize)
   1568 

c:\python34\lib\site-packages\pandas\io\sql.py in create(self)
    646 
    647     def create(self):
--&gt; 648         if self.exists():
    649             if self.if_exists == 'fail':
    650                 raise ValueError("Table '%s' already exists." % self.name)

c:\python34\lib\site-packages\pandas\io\sql.py in exists(self)
    634 
    635     def exists(self):
--&gt; 636         return self.pd_sql.has_table(self.name, self.schema)
    637 
    638     def sql_schema(self):

c:\python34\lib\site-packages\pandas\io\sql.py in has_table(self, name, schema)
   1577         query = flavor_map.get(self.flavor)
   1578 
-&gt; 1579         return len(self.execute(query, [name,]).fetchall()) &gt; 0
   1580 
   1581     def get_table(self, table_name, schema=None):

c:\python34\lib\site-packages\pandas\io\sql.py in execute(self, *args, **kwargs)
   1465             cur = self.con
   1466         else:
-&gt; 1467             cur = self.con.cursor()
   1468         try:
   1469             if kwargs:

AttributeError: 'Engine' object has no attribute 'cursor'
</code></pre>

<p>Also, is there ways to write connection string for <code>create_engine</code> differently? I would love to write it in form of a dictionary rather than a string.</p>

<p><strong>Update</strong>: Here is my new environment:</p>

<p>MS SQL Server: Microsoft SQL Server 2012 - 11.0.2100.60 (X64) 
    Feb 10 2012 19:39:15 
    Copyright (c) Microsoft Corporation
    Standard Edition (64-bit) on Windows NT 6.2  (Build 9200: )</p>

<p>Python: 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)]</p>

<p>Pandas version: '0.16.2'</p>

<p>sqlalchemy version: 1.1.3</p>

<p>Jupyter server version : 4.2.3</p>

<p>Now the line</p>

<pre><code>engine = sqlalchemy.create_engine('mssql+pyodbc://localhost/Sandbox?trusted_connection=yes')
</code></pre>

<p>generates the following error: </p>

<pre><code>c:\python34\lib\site-packages\sqlalchemy\connectors\pyodbc.py:82: SAWarning: No driver name specified; this is expected by PyODBC when using DSN-less connections
  "No driver name specified; "
</code></pre>