首页 > 代码库 > python 连接MSSQL

python 连接MSSQL

# -*- coding: utf-8 -*-import pymssqlconn=pymssql.connect(host=".",user="sa",password="",database="UFDATA_001_2013",charset="utf8")#conn=pymssql.connect(host="kzxserver",database="UFDATA_001_2014",trusted=True)cur=conn.cursor()cur.execute(SELECT * FROM code)row = cur.fetchall()for crow in row:    print (crow)