I have a dataframe that I insert in a base through sqlalchemy and DataFrame.to_sql() function.
engine = create_engine("mssql+pyodbc:///?odbc_connect={}".format( paramdb))
with engine.begin() as conn:
df.iloc[ii:ii+10].to_sql(con=conn, name=table,if_exists='append',index=False)
However I want to be able to insert my dataframe using stored-procedure (with rows values as parameters) and was wondering if there was a way to not have to iterate over every row of my dataframe to insert them one by one. That seems pretty inefficient. I can manipulate up to 3m lines that I split by packages of 500 rows to insert.