• As a bit of a sidebar, I'm concerned for you good folks. One of the indexes you posted appears to have "CardNumber" as a clear text value. I hope I'm misreading that. PCI specs and most specs on PII say that such things must be encrypted.

    Could you attach a copy of what the Clustered Indexes look like (I see you posted 1 already but a single attachment would be convenient) and all the Non Clustered Indexes for the two tables in question? It'll help with analysis.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)