Code Monkey home page Code Monkey logo

pymssql's Introduction

pymssql - DB-API interface to Microsoft SQL Server

image

image

image

image

image

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

bladams avatar damoxc avatar dependabot[bot] avatar dm0- avatar elandt avatar epa avatar erosennin avatar guillaumep avatar johnnymo87 avatar jpgimenez avatar korverdev avatar matusvalo avatar mavlyutov avatar mikhailsidorov avatar mpagel avatar msabramo avatar ph89 avatar primozgodec avatar quentinlegay avatar ramiro avatar randommuser avatar rsyring avatar sietse avatar simonbiggs avatar simonstjg avatar skinowski avatar stsci-sienkiew avatar summonholmes avatar termim avatar testsr 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.