ReleaseMicrosoftMicrosoftpublished Feb 27, 2026seen Jun 26

microsoft/mssql-python v1.4.0

microsoft/mssql-python

Open original ↗

Captured source

source ↗
published Feb 27, 2026seen Jun 26captured 5dhttp 200method plain

v1.4.0

Repository: microsoft/mssql-python

Tag: v1.4.0

Published: 2026-02-27T08:40:13Z

Prerelease: no

Release notes:

Release Notes - Version 1.4.0

Enhancements

  • Bulk Copy Support (#449, #430, #426, #420, #439)

_What changed_: The bulkcopy() method on the Cursor object is now a public API, providing high-performance bulk data loading into SQL Server. Added comprehensive logging support for bulk copy operations with configurable log levels. Enhanced type hints and explicit parameter definitions for better IDE support and type checking. This feature is powered by a new mssql-py-core native extension, please read here https://github.com/microsoft/mssql-rs. _Who benefits_: Developers performing ETL operations, applications requiring high-throughput data imports, teams needing detailed bulk copy operation logging for debugging _Impact_: Enables production use of high-performance bulk inserts, provides visibility into bulk copy operations through logging, ensures secure authentication with EntraID tokens, improves developer experience with better type hints and parameter documentation > Implements #449, #430, #426, #420, #439

  • Spatial Type Support (#423)

_What changed_: Added native support for SQL Server spatial data types including geography, geometry, and hierarchyid. These types are now automatically handled during query execution and result fetching, with proper Python type conversions. Includes comprehensive test coverage for spatial operations. _Who benefits_: Applications working with geospatial data, GIS integrations, users storing location-based information, developers working with hierarchical data structures _Impact_: Enables direct use of SQL Server spatial features from Python, eliminates need for manual type conversions, provides seamless integration with geospatial applications > Implements #423

  • Type Annotations with py.typed Marker (#367)

_What changed_: Added py.typed marker file to the package, enabling full type checking support for static type checkers like mypy, pylance, and pyright. This makes all type hints in the package discoverable and verifiable by type checking tools. _Who benefits_: Developers using static type checkers, teams enforcing type safety in codebases, IDE users wanting better autocomplete and inline documentation _Impact_: Enables compile-time type checking for mssql-python usage, improves IDE intelligence and error detection, enhances code quality through static analysis > Implements #367

Bug Fixes

  • VARCHAR Fetch Failure with Non-ASCII CP1252 Characters (#444)

_What changed_: Fixed a critical bug where fetching VARCHAR columns failed when the data length exactly equaled the column size and contained non-ASCII CP1252 characters (e.g., extended Latin characters like é, ñ, ü). The issue was caused by incorrect buffer size calculations for multi-byte character encodings. _Who benefits_: Applications storing international text data, databases with CP1252 collations, users in European and Latin American regions _Impact_: Prevents data fetch failures for international characters, ensures reliable VARCHAR handling across all character sets, eliminates data truncation issues > Fixes #444

  • Segmentation Fault with Interleaved Fetch Calls (#441)

_What changed_: Fixed a segmentation fault that occurred when interleaving calls to fetchmany() and fetchone() on the same cursor. The issue was caused by improper state management in the underlying result set iterator. Added comprehensive test coverage for various fetch operation sequences. _Who benefits_: Applications using mixed fetch strategies, developers iterating through result sets with different batch sizes, tools dynamically adjusting fetch patterns _Impact_: Eliminates crash risk when mixing fetch methods, ensures stable cursor iteration, improves overall driver reliability > Fixes #427, #441

  • Date/Time Type Code Alignment with ODBC 18 Driver (#355)

_What changed_: Aligned date and time type code mappings with the official ODBC 18 driver source code. This ensures consistent behavior when working with SQL Server date/time types (DATE, TIME, DATETIME2, DATETIMEOFFSET) across Python and other language drivers. _Who benefits_: Applications using temporal data types, developers migrating from ODBC-based solutions, cross-platform applications requiring consistent date/time handling _Impact_: Ensures accurate date/time type handling, eliminates subtle type conversion discrepancies, improves compatibility with other SQL Server drivers > Fixes #352, #355

Developer Experience

  • Development Container Configuration (#147)

_What changed_: Added devcontainer configuration for VS Code, providing a complete, pre-configured development environment with all necessary dependencies, tools, and extensions. Includes Python environment setup, SQL Server instance configuration, and recommended VS Code extensions. _Who benefits_: New contributors setting up development environments, developers wanting consistent cross-platform setups, remote development scenarios _Impact_: Reduces environment setup time from hours to minutes, ensures consistent development environments across team, eliminates "works on my machine" issues > Implements #147