• From your explanation it look's like that your database design is very poor.

    If you still want to perform the task, then I would suggest you to dump everything to staging tables and then use MERGE statement.


    Alex Suprun