python 连接MSSQL

# -*- coding: utf-8 -*-

import pymssql





conn=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)

 

你可能感兴趣的:(python)