I have a SQL Server "Employee" table that I must update from
an XML file periodically. Each month I receive a new XML file
containing all of the company's employees. As you would imagine,
there are some new employees in the list and some reporting
relationships have changed. Other fields like department, and
employee status may change for some employees as well.
Should I try and update the table or just delete the records
in the table and do an insert from the XML file? Right now my code
deletes the records from the table then adds the records back in
using the XML file. The reason that I'm a little worried about this
is because after the record delete, the entire table is laying
exposed until the inserts start happening and if, something goes
wrong with the insert, I'm left with an incomplete or empty table.
Anyway, I'm just looking for an opinion here. Thanks very
much.