📅  最后修改于: 2022-03-11 15:05:02.554000             🧑  作者: Mango
import pandas as pd
import pyodbc
conn = pyodbc.connect('Driver={SQL Server};'
'Server=servername;'
'Database=databasename;'
'Trusted_Connection=yes;')
cur= conn.cursor()
sqlquery = pd.read_sql_query('SELECT * FROM tablename',conn)
print(sqlquery)