SSIS and duplicate rows

I download an XML file from the internet every 30 minutes, this XML file is then split up into 5 different tables. This all works fine, however I have now created 5 new tables mirroring the other 5 with _U appended to the name. What I want to do is every time I do this download, I want to wipe the original tables, load the data in and then only move the records that don't exist in the 5 tables with _U into them, so I only want any data duplication in the _U tables.

What is the easiest way to do this with a bit of an example please.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jerry MillerCommented:
I would do the insert through either one stored procedure that contains the five insert statements or five stored procedures. It really depends on how you want to separate the inserts. But if you do a NOT EXISTS, it will only insert the records that are not duplicates. Which is what I am assuming that you want. You said in the question that you want the duplicates. If that is the case and you want the duplicates, simply remove the NOT from the criteria.

INSERT <tableName_U> (<fieldNames>)
SELECT <fieldnames>
FROM <tableName> a
   NOT EXISTS (SELECT * FROM <tableName_U> b
              WHERE a.uniqueID = b.uniqueID)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.