这就是我的方法
import pyodbc cnxn = pyodbc.connect("Driver={SQL Server Native Client 11.0};""Server=server_name;""Database=db_name;""Trusted_Connection=yes;")cursor = cnxn.cursor()cursor.execute('SELECt * FROM Table')for row in cursor: print('row = %r' % (row,))相关资源:
https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Windows
http://blogs.msdn.com/b/cdndevs/archive/2015/03/11/python-and-data-sql-server-as-a-data-source-for-python-applications.aspx



