This release is about removing friction in real production paths. It fixes transaction handling in with blocks, restores clean-machine imports on Apple Silicon, improves NULL binary parameter binding, removes a class of hangs in SSH-tunnel-style forwarding setups, and unblocks bulk copy with service principal authentication.
Upgrade
pip install --upgrade mssql-python
Highlights
with connection: now commits on success and rolls back on exception
The Connection context manager now implements the documented commit-on-success / rollback-on-exception behavior when autocommit=False. The connection still closes on exit.
Code like this now behaves the way most users already expected it to:
import mssql_python
conn = mssql_python.connect(connection_string, autocommit=False)
with conn:
cursor = conn.cursor()
cursor.execute("INSERT INTO dbo.audit_log(message) VALUES (?)", ("created",))
If the code in the block succeeds, the insert is committed. If the code in the block raises an error, the transaction is rolled back.
Apple Silicon imports work on clean machines again
We fixed the bundled macOS ODBC dylib configuration for every architecture shipped in the universal2 wheel.
For Apple Silicon users, this removes a frustrating failure mode where import mssql_python could point at a missing Homebrew unixODBC path on a clean machine. In 1.11.0, the bundled libraries resolve correctly without a separate unixODBC install.
NULL BINARY and VARBINARY parameters bind more reliably
We fixed the SQLDescribeParam ordinal remapping issue behind GitHub issue #627.
1.11.0 improves parameter binding for NULL binary values, especially in temp-table and table-variable scenarios. When automatic type resolution is not possible, the driver now gives actionable guidance instead of a vague failure, including cursor.setinputsizes() guidance for binary columns.
Bug fixes worth calling out
Shutdown and parameter-typing paths no longer hang SSH-tunnel-style forwarders
We fixed hangs caused by holding the GIL across blocking ODBC operations.
This matters most for users routing connections through an in-process Python TCP forwarder, including SSH-tunnel-style setups. Closing connections and cursors after parameterized queries, as well as executing parameterized queries containing None, no longer wedge the interpreter in those paths.
Bulk copy with service principal authentication no longer freezes
1.11.0 also picks up mssql-py-core 0.1.6, which fixes a freeze affecting bulk copy with Authentication=ActiveDirectoryServicePrincipal.
If you are using service principal authentication for bulk ingest workloads, this release is worth taking promptly.
Upgrading
For most users, pip install --upgrade mssql-python is all you need. If you had local workarounds for broken with connection: transaction behavior, Apple Silicon import issues, or binary NULL parameter binding, 1.11.0 is the release where those workarounds should become unnecessary.
This is not a feature-heavy release. We opted to focus on the friction you are reporting in real production workflows:
- transactional with blocks now persist successful work
- Apple Silicon setup is smoother on clean machines
- binary NULL parameters are more reliable
- SSH-tunnel and threaded forwarding scenarios are less fragile
- service principal bulk copy is unblocked
Thank you
Thanks to everyone who filed issues, sent repros, and reviewed fixes in this cycle. Several of the changes in 1.11.0 came directly from concrete user reports in production-like environments, which made the failure modes easier to reproduce and fix.
If you upgrade to 1.11.0 and hit anything unexpected, please open an issue in the repository.
Repository: microsoft/mssql-python
Issue tracker: open an issue
Release notes: mssql-python v1.11.0
Published Jul 10, 2026
Version 1.0DavidLevy
Microsoft
Joined February 28, 2023
SQL Server Blog
Follow this blog board to get notified when there's new activity