Skip to main content

DB-API interface to Microsoft SQL Server for Python. (new Cython-based version)

Project description

pymssql - DB-API interface to Microsoft SQL Server

https://github.com/pymssql/pymssql/workflows/Linux/badge.svg https://github.com/pymssql/pymssql/workflows/macOS/badge.svg https://github.com/pymssql/pymssql/workflows/Windows/badge.svg http://img.shields.io/pypi/dm/pymssql.svg http://img.shields.io/pypi/v/pymssql.svg

A simple database interface for Python that builds on top of FreeTDS to provide a Python DB-API (PEP-249) interface to Microsoft SQL Server.

Detailed information on pymssql is available on the website:

pymssql.readthedocs.io

New development is happening on GitHub at:

github.com/pymssql/pymssql

There is a Google Group for discussion at:

groups.google.com

Getting started

pymssql wheels are available from PyPi. To install it run:

pip install -U pip
pip install pymssql

Most of the times this should be all what’s needed. The official pymssql wheels bundle a static copy of FreeTDS and have SSL support so they can be used to connect to Azure.

Basic example

conn = pymssql.connect(server, user, password, "tempdb")
cursor = conn.cursor(as_dict=True)

cursor.execute('SELECT * FROM persons WHERE salesrep=%s', 'John Doe')
for row in cursor:
    print("ID=%d, Name=%s" % (row['id'], row['name']))

conn.close()

Recent Changes

Version 2.2.4 - 2022-04-12 - Mikhail Terekhov

General

  • Added bytes and bytearray to support bulk_copy types, thanks to steve-strickland (#756).

  • Use FreeTDS-1.3.9 for official wheels on PyPi.

  • Enable krb5 in Linux wheels, this time for real (#754).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymssgl-2.2.9.dev0.tar.gz (170.5 kB view details)

Uploaded Source

File details

Details for the file pymssgl-2.2.9.dev0.tar.gz.

File metadata

  • Download URL: pymssgl-2.2.9.dev0.tar.gz
  • Upload date:
  • Size: 170.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.11

File hashes

Hashes for pymssgl-2.2.9.dev0.tar.gz
Algorithm Hash digest
SHA256 c848bf235f39700dbab808cc7ab899f92b08e5aa24b1b5c7b78012233a18e8f6
MD5 9a7d9c1691f876cfe68b0fe4c9c1d106
BLAKE2b-256 0a20bfdc9369f3483c62ae3fc8c6ea7bf7dffc0136a28b4867aa4c78473d0d98

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page