Closed hjb417 closed 2 years ago
You can use the attrs_before
parameter of connect()
to do this.
attrs_before = { 1227: 32 }
(Look in msodbcsql.h that comes with the driver for the definition of the constants. These are driver-specific attributes.)
I'm able to set it for now by specifying the ids
SQL_COPT_SS_TXN_ISOLATION = 1227 # SQL_COPT_SS_BASE+27
SQL_TXN_SS_SNAPSHOT = 32
autocommit = conn.autocommit
conn.autocommit=True
conn.set_attr(SQL_COPT_SS_TXN_ISOLATION, SQL_TXN_SS_SNAPSHOT)
conn.autocommit=autocommit
Thanks for the workaround!
May you allow us to set the connection attribute SQL_COPT_SS_TXN_ISOLATION. It's needed to set the transaction isolation level to SNAPSHOT.
https://docs.microsoft.com/en-us/sql/relational-databases/native-client-odbc-api/sqlsetconnectattr?view=sql-server-ver15