• Agreed,

    However it still needs re-writing as it has a massive overuse of temp tables.

    7,000 of them cached in the tempdb.

    It was causing a performance issue.

    I freed the proc cache and saw a drastic performance increase.

    Regards,

    Simon