连接sql server数据库,需要导入第三方库pymssql。
import pymssql
server = "" # 连接服务器地址
user = ""
password = ""
conn = pymssql.connect(server, user, password, "RPAMON") #获取连接
cursor = conn.cursor
连接sql server数据库,需要导入第三方库pymssql。
import pymssql
server = "" # 连接服务器地址
user = ""
password = ""
conn = pymssql.connect(server, user, password, "RPAMON") #获取连接
cursor = conn.cursor