sql server - Better Practice: Delete&Insert vs. Update -
i need parse data (~60000 rows) csv file , write them mssql table (the data date/time , value decimal number). each day 1 such csv file. catch is, in csv file each day have data last 5 days, meaning have data dates wrote in past days, need replace data file.
i trying decide between 2 methods: bulk delete of old data need re-write when new csv file, , insert, vs finding each record based on date&time , id , update it.
1.what better practice cause less fragmentation , maintenance issues on database?
- which be less expensive performance point of view?
if comes choosing between two, prefer keeping db in shape on high performance because file written during night anyway.
edit: in case i'll add maintenance plan rebuilds indexes on daily basis after bulk deletion , insertion of new data, enough avoid fragmentation issues, or there missing?
faster & better way delete old data, import data ssis or bulk insert in case if don't have ssis , rebuild fragmented indexes. example script.
Comments
Post a Comment