I want to set up a job that dumps data into a SQL table every day, overwriting the existing data.
df.to_sql(table_name, engine, schema='dbo',
index=True, index_label='IdColumn',
if_exists='replace')
However behind the scenes SQLAlchemy is trying to create the table with IdColumn VARCHAR(max), and being nullable. So SQL throws an error when it tries to create the index.
It's pretty trivial to truncate the table before I write the data to it, but I feel like there should be a more elegant solution to this problem.