• thanks

    I suspect it's going to be a while before it gets upgraded from 2008 R2 and I will have long since retired by then

    for now it's a 20 minute process instead of an hour and a half (I shudder to think what it would have taken with the original code - a cursor within a cursor processing 3 million records in an early morning job)