Efficiently inserting data into an SQL table with pymssql

Viewed 32

Given a table with a several dozen columns what would be a proper way to insert data from a dataframe with something like:

for index, row in df.iterrows():
  cursor.execute("INSERT INTO dbo.table(column1,...column99) values(%s,...)",(row.column1,...row.column99)

without having to type dozens of %s, considering that it's inside a string?

0 Answers
Related