import pyodbc
import pandas as pd
conn = pyodbc.connect('Driver={SQL Server};'
'Server=<server-hostname>;'
'Database=<database-name>;'
#'Trusted_Connection=yes;'
'uid=<login-id>;'
'pwd=<login-password>;')
df = pd.read_sql_query('SELECT * FROM <table-name>', conn)
print(df)
Thanks for reading and happy learning!
billy-at-python.sg