Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pymssql
- conn = pymssql.connect(host="hostname", user="username@hostname", password="pass", database="dbname")
- cursor = conn.cursor()
- cursor.execute('SELECT * FROM SalesLT.Customer WHERE CustomerID=%d', 1)
- row = cursor.fetchone()
- while row:
- print("ID=%d, Name=%s" % (row[0], row[3]))
- row = cursor.fetchone()
- conn.close()
- export PYMSSQL_BUILD_WITH_BUNDLED_FREETDS=1
- pip install pymssql
- Traceback (most recent call last):
- File "test.py", line 8, in <module>
- conn = pymssql.connect(host="hostname",user="username@hostname",password="pass",database="dbname")
- File "pymssql.pyx", line 641, in pymssql.connect (pymssql.c:10824)
- pymssql.OperationalError: (20002, 'DB-Lib error message 20002, severity 9:nAdaptive Server connection failedn')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement