We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bd9014 commit b09c307Copy full SHA for b09c307
samples/tutorials/python/jupyter/sample_python_jupyter.py
@@ -0,0 +1,17 @@
1
+import pyodbc
2
+server = 'myserver'
3
+database = 'mydb'
4
+username = 'myusername'
5
+password = 'mypassword'
6
+
7
+#Connection String
8
+cnxn = pyodbc.connect('DRIVER={SQL Server Native Client 11.0};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
9
+cursor = cnxn.cursor()
10
11
+#Sample select query
12
+cursor.execute("SELECT @@version;")
13
+row = cursor.fetchone()
14
+while row:
15
+ print row[0]
16
+ row = cursor.fetchone()
17
0 commit comments