Append new data to same SQL table in R

Hi i have 15 columns in data frame (daily values) which i have written in SQL table from R. Now i want to append and update it every time i run analysis on new data. e.g i have table with information till march 2021 now at the end of April i want to update the same table with April values. Column numbers are same.
I am using the following code however it doesnt append when i run the analysis with new data.

Any clue ?

#write to SQL
#connection <- odbcDriverConnect('driver={SQL Server};server=server\\SQLEXPRESS,1433;database=xxx;uid=xxx;pwd=xxx')
data <-data.frame(df,check.names = F)
sqlSave(connection,data,tablename= "abc",rownames=F,append=T)
odbcClose(connection)

Try using DBI::dbAppendTable()

https://rdrr.io/cran/DBI/man/dbAppendTable.html

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.