I can't seem to figure out what I'm doing incorrect in writing rows to a SQL Server using python 3.11.4, pyodbc 4.0.39, sqlalchemy 2.0.20. The problem is that about 100k rows takes nearly a day and a half to insert into a table. The table does not have any indexes and is empty. I'm hoping the snippet of code provide some insight.
cn_1 = sa.create_engine('mssql+pyodbc://servername/dbname?driver=ODBC+Driver+17+for+SQL+Server', fast_executemany=True)
df.to_sql(
"mytable",
cn_1,
if_exists="replace",
index=False,
)