• A final update.........

    The original code was running for 10 hours and then failing with timeout issues. A MERGE statement was created and tested with a small set of data to ensure that the output was the same as before.

    This code has now been tested with the same load as before and instead of running for the 10 hours (and failing) it ran for five minutes and completed !!!

    I would like to thank everyone who helped on this thread. Especially SSCrazy (Scott Coleman).....:-D

    I would also like to thank Jeff Moden for this article that was used in the testing of the tables: http://weblogs.sqlteam.com/jeffs/archive/2004/11/10/2737.aspx