Skip to navigation
Get pymssql results as dicts with columns name
10.03.14
add the paramenter as_dict=True example import pymssql conn = pymssql.connect(host='SQL01', user='user', password='password', database='mydatabase', as_dict=True) cur = conn.cursor() cur.execute('SELECT * FROM persons WHERE salesrep=%s', 'John Doe') for row in cur: print "ID=%d, Name=%s" % (row['id'], row['name']) conn.close()
http://pymssql.sourceforge.net/examples_pymssql.php
Reply
Anonymous
Information Epoch 1732527887
Think hierarchically.
Home
Notebook
Contact us