python2.7 x64版本下pymssql的安装:
直接使用pip install pymssql安装即可。
python默认安装在C:\Python27\下,easy_install和pip这两个功能在C:\Python27\Scripts
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os,pymssql
server="192.168.1.66"
user="user"
password="password"
conn=pymssql.connect(server,user,password,database="yanshi_scm")
cursor=conn.cursor()
sql="""select FNumber,FName_L2 from t_org_COMPANY order BY fnumber"""
cursor.execute(sql)
row=cursor.fetchone()
while row:
print row[0],row[1]
row=cursor.fetchone()
conn.close()