Git Product home page Git Product logo

pymssql's Introduction

pymssql - DB-API interface to Microsoft SQL Server

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.

Note

On some Linux distributions pip version is too old to support all the flavors of manylinux wheels, so upgrading pip is necessary. An example of such distributions would be Ubuntu 18.04 or Python3.6 module in RHEL8 and CentOS8.

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()

pymssql's People

Contributors

msabramo avatar termim avatar ramiro avatar rsyring avatar bladams avatar dependabot[bot] avatar skinowski avatar damoxc avatar simonstjg avatar korverdev avatar primozgodec avatar erosennin avatar epa avatar jpgimenez avatar ski7777 avatar mavlyutov avatar johnnymo87 avatar testsr avatar sietse avatar quentinlegay avatar matusvalo avatar juntangc avatar wb7777 avatar mikhailsidorov avatar guillaumep avatar simonbiggs avatar summonholmes avatar randommuser avatar ph89 avatar mpagel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.