sql1 = "select name from syscolumns where id = object_id('tbl_EOR_Data')"
cursor.execute(sql1) # 执行sql语句
row = cursor.fetchone() # 读取查询结果
list = []
while row: # 循环读取所有结果
list.append(row[0])
row = cursor.fetchone()
new_list = []
for i in range(len(list)):
a = list.pop()
new_list.append(a)
Python——SQL Server读取表中所有列名
最新推荐文章于 2023-07-19 14:31:25 发布