import pandas as pd
file_path = 'D:/1.xlsx'
sheet_name = '1'
table_name = 'your_table_name'
df = pd.read_excel(file_path, sheet_name=sheet_name)
columns = ', '.join(df.columns)
insert_statements = []
for index, row in df.iterrows():
values = ', '.join([f"'{str(value)}'" for value in row.values])
sql = f"INSERT INTO {table_name} ({columns}) VALUES ({values});"
insert_statements.append(sql)
for statement in insert_statements:
print(statement)