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?
Install pyodbc using pip as follows: pip install pyodbc
import pyodbc
cnxn = pyodbc.connect("DRIVER={SQL Server};SERVER=SOME-PC;DATABASE=my_db")
cursor = cnxn.cursor()
cursor.execute("insert into test_tb values(6, 'name')")
cursor.execute("select id, name from my_tb")
rows = cursor.fetchall()
for row in rows:
print row.id, row.name
For details, see
https://github.com/mkleehammer/pyodbc/wiki