Skip to content

Instantly share code, notes, and snippets.

@earthday
Created December 8, 2014 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earthday/39c7e618689debd30f25 to your computer and use it in GitHub Desktop.
Save earthday/39c7e618689debd30f25 to your computer and use it in GitHub Desktop.
conn = pymssql.connect(server, user, password, "tempdb")
cursor = conn.cursor()
cursor.execute('SELECT * FROM persons WHERE salesrep=%s', 'John Doe')
for row in cursor:
print('row = %r' % (row,))
conn.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment