文件名称:python类pymssql安装包
文件大小:176KB
文件格式:RAR
更新时间:2014-03-02 03:38:00
python,pymssql,安装包
pymssql 是Python语言用来连接微软 SQL SERVER 数据库的类库,实现了 Python DB API 2.0 。 示例代码: import pymssql conn = pymssql.connect(host='SQL01', user='user', password='password', database='mydatabase') cur = conn.cursor() cur.execute('CREATE TABLE persons(id INT, name VARCHAR(100))') cur.executemany("INSERT INTO persons VALUES(%d, %s)", \ [ (1, 'John Doe'), (2, 'Jane Doe') ]) conn.commit() cur.execute('SELECT * FROM persons WHERE salesrep=%s', 'John Doe') row = cur.fetchone() while row: print "ID=%d, Name=%s" % (row[0], row[1]) row = cur.fetchone() conn.close()
【文件预览】:
pymssql-1[1].0.2.win32-py2.5.exe