• In SQL SERVER 2008 and above you have the MERGE statement. Unfortunately that does not apply to your version of SQL SERVER. For this you should stick with the three statements for changing table content across batches. These are INSERT, UPDATE, DELETE. Have a staging table with the newer data set. Do joins on the that to the permanent dataset and depending on the condition, apply one of the statements above.

    EX/// If updating an existing record your data sets is defined by

    stageTable inner join permanentTable on join columns...

    update t

    set t.mycolumn = s.mycolumn, t.updateDateTime = getdate() /*can do for all your columns */

    from stageTable as s inner join permanentTable as t on t.keyField= s.keyField /* both the same of course */

    A insert would pull the columns resulting from stageTable left joining on permanentTable where the permanentTable keyfield is null (because it does not exist in there yet).

    For the history portion of your question... You can add triggers to the table to handle Inserts and Deletes and append those changed, deleted rows to a history table similar in structure. Have date inserted or similar audit columns in there.

    Hope this helps you get started.

    ----------------------------------------------------