Is there a module available for connection of MSSQL and python 2.7?
I downloaded pymssql but it is for python 2.6. Is there any equivalent module for python 2.7?
I am not aware of it if anyone can provide links.
Important note: in the meantime there is a pymssql module available. Don't miss to read the answer at the end of this page: https://stackoverflow.com/a/25749269/362951
You can also use pyodbc to connect to MSSQL from Python.
An example from the documentation:
The SQLAlchemy library (mentioned in another answer), uses pyodbc to connect to MSSQL databases (it tries various libraries, but pyodbc is the preferred one). Example code using sqlalchemy:
You can try out SQLAlchemy: The SQLAlchemy Object Relational Mapper presents a method of associating user-defined Python classes with database tables, and instances of those classes (objects) with rows in their corresponding tables.
You can refer following links: 1> http://www.sqlalchemy.org/docs/ 2> http://www.rmunn.com/sqlalchemy-tutorial/tutorial.html
Install
pyodbc
using pip as follows:pip install pyodbc
For details, see
https://github.com/mkleehammer/pyodbc/wiki
If you're coming across this question through a web search, note that
pymssql
nowadays does support Python 2.7 (and 3.3) or newer. No need to use ODBC.From the
pymssql
requirements:See http://pymssql.org/.