📅  最后修改于: 2022-03-11 14:45:59.869000             🧑  作者: Mango
result = None
with pyodbc.connect('DRIVER={SQL Server};SERVER=mydb;DATABASE=solarwinds;Trusted_Connection=True', timeout=1) as cnxn:
cursor = cnxn.cursor()
result = cursor.execute(query).fetchall()