* Mike Bayer (Sun, 27 Aug 2017 11:35:27 -0400)
>
> On Sun, Aug 27, 2017 at 9:52 AM, Thorsten Kampe
> <
thor...@thorstenkampe.de> wrote:
> > Hi,
> >
> > is it possible to enable autocommit for a MSSQL
> > connection with Pymssql? The feature is available in
> > Pymssql since 2014. PyODBC - the default MSSQL driver -
> > supports autoconnect in the connection string.
> >
> > I have been unsuccessful trying to enable autocommit in
> > the connection string or as a keyword for
> > `create_engine` (`isolation_level = 'AUTOCOMMIT'` or
> > `autocommit = True`).
>
> the pyodbc connector does accept 'autocommit' as a query parameter
> which will be coerced to boolean, so this should work:
>
> create_engine("mssql+pyodbc://scott:tiger@dsn?autocommit=true")
Thanks for the quick answer. My question was
specifically about the PyMSSQL driver (not the PyODBC
driver).
The reason why I'm asking is that I would like to
connect from Linux.
PyODBC works fine on Windows. On Linux I simply don't
know what to use instead of...
driver=SQL+Server+Native+Client+11.0
...in the connection string when using a "Hostname-
based connection".
Thorsten