Articles Related
Client
Application
Python pyodbc library
- Python Script
python -c myPythonScript.py
import pyodbc
# Connect String
cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=SQLSRV01;DATABASE=DATABASE;UID=USER;PWD=PASSWORD')
# Oracle: 'DRIVER=MyOracle;DBQ=x.x.x.x:1521/orcl;UID=myuid;PWD=mypwd'))
# Retrieve the cursor
cursor = cnxn.cursor()
cursor.execute("SELECT ***")
for row in cursor.fetchall():
print row