"No driver name specified" writing pandas data frame into SQL Server table "No driver name specified" writing pandas data frame into SQL Server table pandas pandas

"No driver name specified" writing pandas data frame into SQL Server table


You need to specify both that you want to use ODBC and what ODBC driver to use.

engine = sqlalchemy.create_engine('mssql+pyodbc://localhost/Sandbox?driver=SQL+Server+Native+Client+11.0')

Trusted connections are the default, so you don't need to specify that, although it shouldn't hurt to do so.


The likely problem is that you have not specified the driver, so try:

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

This is based on the warning message that you got on the top:

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; "

Note that you can also use pymssql instead of pyodbc, but MS recommends the latter.


EDIT


Here is official documentation on how to connect with/without DSN (data source name):

https://github.com/mkleehammer/pyodbc/blob/master/docs/index.md#connect-to-a-database


I know the question has been answered for some time now and it's just a warning, but if you have transferred everything correctly and this error still occurs it's annoying.

For all those who had to struggle with it like I did, you can also enter the driver directly in the script, Pyodbc.py offers the possibility for this (row 26 - 28):

    # for non-DSN connections, this *may* be used to    # hold the desired driver name    pyodbc_driver_name = 'ODBC Driver 17 for SQL Server'