Py学习  »  Alfred Huang  »  全部回复
回复总数  1
6 年前
回复了 Alfred Huang 创建的主题 » 正在将Microsoft SQL Server中的数据读取到Python中[重复]

尝试使用PytDS,它比整个更复杂的环境工作。 pyodbc 更容易安装。

我在Ubuntu18.04上成功了

裁判: https://github.com/denisenkom/pytds

文档中的示例代码:

import pytds
with pytds.connect('server', 'database', 'user', 'password') as conn:
    with conn.cursor() as cur:
        cur.execute("select 1")
        cur.fetchall()