安装pymssql
示例代码:
import pymssql
conn = pymssql.connect(host='192.168.40.100', user='music', password='123456789', database='radiodb')
cur = conn.cursor()
cur.execute('SELECT TOP 10 singerid FROM radio')
row = cur.fetchone()
while row:
print "ID=%d" % (row[0])
row = cur.fetchone()
conn.close()
posted on 2011-03-21 17:10
漂漂 阅读(979)
评论(0) 编辑 收藏 引用