import pandas as pd
读取Excel文件中的数据
df = pd.read_excel('diseases.xlsx')
遍历每一行,生成插入SQL语句
for index, row in df.iterrows():
disease_name = row['疾病名称'] # 假设A列是疾病名称
sql = f"INSERT INTO [pss_common_diseases] ([Common_diseases_name]) VALUES (N'{disease_name}');"
print(sql) # 或将其写入到数据库中