Forums

Installing Microsoft ODBC Driver for SQL

Is it possible to get the Microsoft ODBC Driver for SQL instead of FreeTDS?

I have come to learn that there are some restrictions with FreeTDS , from "stackoverflow:

"fast_executemany = True uses an ODBC feature called "parameter arrays" and that feature is not supported by all ODBC drivers. Apparenty FreeTDS ODBC is one of those drivers that does not support it.

If you really need to use fast_executemany = True you can use Microsoft's ODBC Driver for SQL Server. It does support ODBC parameter arrays."

I tried to install it for linux following this guide, though without luck.

The result of using FreeTDS is that it is very slow at importing my dataframe into a mssql server. Normally people use:

engine = sqlalchemy.create_engine(conn, fast_executemany=True)
df.to_sql(table_name, engine, if_exists = 'replace', chunksize = None)

Though this is not an option with FreeTDS and result in python crashing.

I've raised a ticket to include that in our next system image build, which should be available in a few months.

Hi Glenn it is very problematic that I cant use the Microsoft ODBC driver - is there any workaround that can be done now? Don't want to change to another service as I really enjoy python anywhere!

Not really, unfortunately.

Hi there, is there an update on whether a version of Microsoft ODBC will be available for use soon?

not yet.

We've been looking into installing this, but unfortunately the licensing terms (the EULA) associated with the drivers are not something we can comply with -- if we had it pre-installed, we'd need to get every PythonAnywhere user to agree to a Microsoft license in order to use our system at all, which would be a problem for a significant number of people.