--- id: mssql-python version: "1.13.0" license: unclear license_treatment: unclear maintenance: active --- # mssql-python — A Python library for interacting with Microsoft SQL Server License: unclear · Maintenance: active · Downloads: 2.5M/mo ## What it is and what it does mssql-python is Microsoft's official Python driver for SQL Server and Azure SQL. It replaces the traditional pyodbc-style architecture with DDBC (Direct Database Connectivity), a lightweight C++ layer that bypasses the platform's driver manager and interfaces directly with native SQL Server drivers. This design eliminates the need to install a separate driver manager on Windows and provides consistent behavior across Windows, macOS, and Linux. The driver is built with PyBind11 for memory-safe, high-performance bindings. It supports modern authentication via azure-identity (DefaultAzureCredential, ManagedIdentityCredential, and custom token providers), identity-aware connection pooling with automatic token refresh, and bulk operations including a new Arrow-based bulk copy method for high-performance data loading. Recent fixes address parameter binding edge cases, output converter dispatch, and cursor lifecycle management. Use it for: - Connect to Azure SQL Database or SQL Server from Python applications without installing external driver managers. - Bulk-load data from PyArrow tables or RecordBatches using the new bulkcopy_arrow() method for high-throughput ETL. - Authenticate to SQL Server using Azure managed identities or DefaultAzureCredential from azure-identity. - Execute parameterized queries with automatic type conversion and memory-safe bindings via PyBind11. - Use connection pooling with automatic token refresh for long-running applications accessing SQL Server as different Azure identities. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Python driver for connecting to and querying Microsoft SQL Server, Azure SQL, and SQL databases in Fabric, using a direct C++ backend (DDBC) instead of platform-specific driver managers. Yes, with conditions. mssql-python is actively maintained, recently released (7 days ago), and offers a modern alternative to pyodbc with no external driver-manager dependency on Windows. It has no known vulnerabilities and supports current Python versions (3.10–3.12). However, verify the license terms before production use, as the license treatment is currently unclear. If you are building a new SQL Server integration and can target Python ≥3.10, this is a solid choice; if you need legacy Python support or have existing pyodbc code, stick with that. ## Install pip install mssql-python uv add mssql-python poetry add mssql-python ## Installing mssql-python Before you install: Medium install friction due to compiled wheels for multiple platforms and Python versions (3.10–3.12). Active maintenance with a release 7 days ago. Depends on mssql-python-odbc (hard dependency as of v1.13.0) and azure-identity for token-based auth; on Windows, no external driver manager is required. License in practice: License treatment is unclear—no SPDX identifier or raw license text is recorded. Before production use, verify the actual license terms on the project repository. Quickstart: pip install mssql-python import mssql conn = mssql.connect(server='localhost', database='mydb', user='sa', password='pass') cursor = conn.cursor() cursor.execute('SELECT * FROM table') for row in cursor.fetchall(): print(row) Requires Python ≥3.10. mssql-python-odbc is automatically installed as a dependency. On non-Windows platforms, the ODBC driver binaries are included in the mssql-python-odbc package. Verify before relying: - Exact license terms and any restrictions on commercial or proprietary use - Performance benchmarks vs. pyodbc or other SQL Server drivers - Full API surface and support for advanced features (e.g., stored procedures, transactions, connection pooling limits) ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 2.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags sql server python driver, azure sql python connector, mssql database client, sql server odbc alternative, python database driver, sql-server, azure-sql, odbc-alternative [View on SkillFed](https://skillfed.io/packages/mssql-python) · [View on PyPI](https://pypi.org/project/mssql-python/)