Hi I am trying to write a csv file into a table in SQL Server database using python. I am facing errors when I pass the parameters , but I don\'t face any error when I do it
You can pass the columns as arguments. For example:
for rows in csv_data: # Iterate through csv cur.execute("INSERT INTO MyTable(Col1,Col2,Col3,Col4) VALUES (?,?,?,?)", *rows)