Python Connector for SQL Server
Python Connector for SQL Server is a connectivity solution for accessing SQL Server databases from Python applications. It fully implements the Python DB API 2.0 specification. The connector is distributed as a wheel package for Windows, macOS, and Linux.
Direct connection
The connector enables you to establish a direct connection to SQL Server from a Python application via TCP/IP, eliminating the need for the database client library. A direct connection increases the speed of data transmission between the application and SQL Server database server. It also streamlines the deployment process since you don't have to distribute any client libraries with the application.
Secure communication
The connector supports encrypted communications using SSL/TLS, SSH tunneling, and HTTP/HTTPS tunneling.
Connecting
To establish a connection to a SQL Server database, import the connector and
use the connect() method with your connection parameters.
Import the connector
First, import the SQL Server connector module:
import devart.sqlserver
Establish a connection
Connect to a database using the connect() module method and obtain a connection object.
You can connect using either mixed mode authentication and Windows authentication.
Mixed mode authentication
For mixed mode authentication, provide your server name, database, user ID, and password:
my_connection = devart.sqlserver.connect("Authentication=Windows;Server=your_server;Database=your_database")
Replace the example values with your actual server name, database, and database credentials.
Windows authentication
For Windows authentication, provide your server and database names. The connector will use your Windows account credentials:
my_connection = devart.sqlserver.connect("Authentication=Windows;Server=your_server;Database=your_database")
Replace the example values with your actual server and database names.
Querying data
Once connected to SQL Server, you can execute SQL queries to retrieve data from your SQL Server database.
Execute a query
Create a cursor object using the cursor() connection method.
my_cursor = my_connection.cursor()
Execute a SQL query using the execute() cursor method.
my_cursor.execute("SELECT * FROM employees")
Retrieve results using one of the fetch*() methods.
for row in my_cursor.fetchall():
print(row)
Parameterized queries
You can use parameterized queries to pass variable values to your SQL statements. This allows you to reuse the same query with different data and helps to prevent SQL injection attacks.
Pass parameters as a list or tuple to the
execute()
method:
query = "SELECT Id, Name FROM Contact WHERE Name = ? AND Email = ?"
params = ["Jordan Sanders", "jordansanders@example.com"]
my_cursor.execute(query, params)
results = my_cursor.fetchall()
for row in results:
print(row)
Each placeholder ? in the query is replaced with a corresponding value from the parameter list.
Ordering and activating the license
You can purchase a license for the connector on the ordering page:
https://www.devart.com/python/sqlserver/ordering.html
To activate the license, follow the instructions in the documentation:
https://docs.devart.com/python/sqlserver/activate-a-license.htm
What's new
Python Connector for SQL Server 1.4
- Added support for Python 3.15
- Added support for SQL Server 2025
- Added support for Always Encrypted
Metadata
Release files for devart-sqlserver-connector 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 58.0 MB
Release files / devart_sqlserver_connector-1.4.0-cp315-cp315-win_amd64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp315-cp315-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.15 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3f199ba8fbdcf632588a5183afaeaf9229587f36c323e30ece8d7b864e794267
|
|
BLAKE2b-256 checksum How to use checksums |
607fc7797bc5adf3d6cfc483836b2df8d8ef0cda5e05abf8d3d5433f9cc12ea7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp315-cp315-win32.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp315-cp315-win32.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.15 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
cd437a70936af8c1c4fd5dc524532c7fbd7f324ef787d965a9b41342d699fd81
|
|
BLAKE2b-256 checksum How to use checksums |
d0ffd7d873303ad05250bf29b03b071cc712523dc9b7426a8fbadbcfe30df7f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp315-cp315-manylinux_2_34_x86_64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp315-cp315-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.15 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
e7af48bf812329c71c1c3365201c1464dc0897bdfc75f773e75bc2c7be258e0f
|
|
BLAKE2b-256 checksum How to use checksums |
5c21691aea5ebe3ba3294670b4e613a51573d9a68485c35148a6e185148560bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp315-cp315-macosx_10_15_universal2.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp315-cp315-macosx_10_15_universal2.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.15 macOS 10.15+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
62ef69753de16c454f8246b86faca46a485ea61d1809be63a0719651aee823bc
|
|
BLAKE2b-256 checksum How to use checksums |
774944bdde80c0cd47d8eeb9debc8a51b1349148f60f4f54855b1bf7683eca8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp314-cp314-win_amd64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ab7419ce47dec52b60e14379e7e258d85dadad078a251247bc505bd406a273b2
|
|
BLAKE2b-256 checksum How to use checksums |
95d635568c05b8eb64b9ee41b1b81b0cc39391ac562cd90b9d21af477de9f8f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp314-cp314-win32.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp314-cp314-win32.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.14 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
be00c60339c1876ae21bc283ec97460849217e94198493734c40bdd9fbd4a7f3
|
|
BLAKE2b-256 checksum How to use checksums |
e7d347a263a714db78fc4dda195eafe31532627ab966e2057ce98db5e897e39c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp314-cp314-manylinux_2_34_x86_64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp314-cp314-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.14 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
3e34b2a8f6880ef6d14a2bb93a595ca98e9da666d4b49f850181d12bd700987a
|
|
BLAKE2b-256 checksum How to use checksums |
204645a0cf38423a895011aaa3d259ac8d817d039a3225921a515563a4715924
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp314-cp314-macosx_10_15_universal2.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp314-cp314-macosx_10_15_universal2.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.14 macOS 10.15+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
39c949b7233f3327c6b0471e56bc880b6bb54ae26d13779abc0e6a2f9d41f8fe
|
|
BLAKE2b-256 checksum How to use checksums |
3d99deb11fc8112b53aa5cfcbb5d8c7bc2e8ded3c106a528c16864a68ea5352e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp313-cp313-win_amd64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
96344bc327e04384733e023389a0132ada748d4d4f174954127cc4dce33ce529
|
|
BLAKE2b-256 checksum How to use checksums |
62a76d26a85ba057ea15f94dc3195efcf6ce1ad38fed251f4ad10076a70f4bbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp313-cp313-win32.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp313-cp313-win32.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
f8b3d739011537adbb6386b8f646e2606dcacab377983cca6f19a917c5f6d1f5
|
|
BLAKE2b-256 checksum How to use checksums |
cfeafeec1c9ada27f9539c70b1caad952bb3a6e4442a89651a385b76c7446eae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp313-cp313-manylinux_2_34_x86_64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp313-cp313-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.13 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
716de850a01bdb9296e17a424082823aa1bcc282edb5f3664d51e24b6963fe63
|
|
BLAKE2b-256 checksum How to use checksums |
43315d1373b660982dbcc3b9bb0ff32cc89d2fffe10b378ce58ef7f4b523da62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp313-cp313-macosx_10_13_universal2.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp313-cp313-macosx_10_13_universal2.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
2bf298fe49252a2d808c57aa011d50d92f62d230ea847df8a0072a8038763843
|
|
BLAKE2b-256 checksum How to use checksums |
9bb80dd638d8e78f5d1c0088c1338469ca49207c95510e024df112a3d7878e02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp312-cp312-win_amd64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f45b6ff8520e6d11d95a4868d1c344fc2ff56d8d7039bf5229a1b6d0790e1202
|
|
BLAKE2b-256 checksum How to use checksums |
eaccf0f3ed624744d24da44249256d46551ca16ccc4792d9531bad8a17fc175d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp312-cp312-win32.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp312-cp312-win32.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
0225be73ec31c95e7bbe9e9458ca202aed3eac087dd796f3577c1ff2ad7f3d15
|
|
BLAKE2b-256 checksum How to use checksums |
8be6100c729e01421df398b96886ae0ebbd545116b53c27b72952d0fba8b6bb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
c9c952036ba18a4b673e749ff7b3010776f27a038c6ee995f6150b41bd0ab50e
|
|
BLAKE2b-256 checksum How to use checksums |
ee33c3215fce0f314f7a0aa70a074ceb4cdbe6a5115d1e91b1e2754a3825f7b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp312-cp312-macosx_10_9_universal2.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp312-cp312-macosx_10_9_universal2.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
79b597e9531502722d0f0be34d4260830549df46e8ce232d5089d6945e2484b9
|
|
BLAKE2b-256 checksum How to use checksums |
37ef2770cef11b202fd6d25717c79a7a8c615abc7640047b08e1f6a7f2365286
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp311-cp311-win_amd64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
df10cb7854228a9b0b25e7312ef2f1f80d33906251c9e85ec1f4b7cbcc247e85
|
|
BLAKE2b-256 checksum How to use checksums |
1bd318297ec04680db5180543884ab579d3bd4a2c331e476580a26b1894acadc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp311-cp311-win32.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp311-cp311-win32.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
fe92f836a2d41fbb77cdb0be494d9174e40fe837f41958e08c404d5cbd1d8ec7
|
|
BLAKE2b-256 checksum How to use checksums |
c4d1386f33bc994390f7019bed38df1c92b05860c030596a36f68694b0590592
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
d4228ea1c2dbb94cbffab6712c8a9daddd5ce7efed7efa1d160716b816215d6d
|
|
BLAKE2b-256 checksum How to use checksums |
8b5a0769c5772300422848faf4437b81463384b88ecd4187d428e0d0f3d714df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp311-cp311-macosx_10_9_universal2.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp311-cp311-macosx_10_9_universal2.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
aa95a3b87b9592b533863920c96bbb42beeae554dccb49b84213747458576c99
|
|
BLAKE2b-256 checksum How to use checksums |
4f72743e8f74f874ea2d09da927a1a21488a3d69a1f98db35c95cf8ba5d81562
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp310-cp310-win_amd64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
832e4741a07e1dbaa83ae6160ac8f4706e5d912bb6d2aff1d7c9c07f0eec34ed
|
|
BLAKE2b-256 checksum How to use checksums |
abbfe844bf4beafe3208679d27afa0edf53f535bbf55343f1627ae368a9ffb68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp310-cp310-win32.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp310-cp310-win32.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
0a3a5469f063e316973bfb11067bf21b6c055d68fc51a86592ac9ad5fc95426c
|
|
BLAKE2b-256 checksum How to use checksums |
fc21884f62d4793dacfb3639cec60e7a1c955b785baeaa2a2aec24f628455a9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp310-cp310-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
94e6435ba0a721164663049e83fd5cf35d423b54c187c0fa8148165b12da31cc
|
|
BLAKE2b-256 checksum How to use checksums |
727567b7f7fc0f2bacbdae484201f7773b64d08ac0319c26d5815ed2c2d01169
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_sqlserver_connector-1.4.0-cp310-cp310-macosx_10_9_universal2.whl
| Download URL | devart_sqlserver_connector-1.4.0-cp310-cp310-macosx_10_9_universal2.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
7b5d0c34d1eab73cc2f88892cf1bf913f7f790de59de14d963ea416c33dcd2d9
|
|
BLAKE2b-256 checksum How to use checksums |
efa8cd29f1a156116a41c62f7371aada2d6665cd1e05dc8436b28df18ed12486
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Security for devart-sqlserver-connector 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.