I m trying to update and add new data frame a pandas data frame in a SQL DB.
I have 2 queries: one is import all datas in DF (more than 100.000) and compare it with sql table with this code:
df.to_sql(table_name, con=engine, if_exists='replace', index=False)
the second one is same import and query but in just import data in a specific period to data frame and import it in the same sql table. Code used is the same:
df.to_sql(table_name, con=engine, if_exists='replace', index=False)
My issue is: when I used my second code, it erase all existing data in sql table which is not existing in my second code (partial import).
could someone give me advice ?
for info, ma database is on Azure
thanks and happy new year