原文:https://www.cnblogs.com/ImOrange/p/10666728.html
原文:https://blog.csdn.net/qq_38125058/article/details/86605232
# https://www.cnblogs.com/ImOrange/p/10666728.html
# https://blog.csdn.net/qq_38125058/article/details/86605232
import pymssql
import pandas as pd
connect = pymssql.connect('192.168.2.51','sa','Sql123456','LZQMS') #服务器名,账户,密码,数据库名
if connect:
print("连接成功!")
cursor = connect.cursor()
sql = 'SELECT * FROM dbo.AcountUsers'
cursor.execute(sql)
row = cursor.fetchone()
print(row)
cursor.close()
connect.close()