• roger.plowman - Wednesday, March 13, 2019 6:49 AM

    Of course, you could always take the brute force approach. 🙂

    Create a table with all valid SSNs and set up a left join to it.

    By today's standards a table of all valid SSNs wouldn't be that big (< 1 billion records of 1 int field as clustered index). Of course it might take a few days to generate, based on how many rules you want to include, but once finished you never have to do it again!

    Kind of like a rainbow table used for the power of good!

    But first, stop storing the damned things in an unencrypted fashion. 😉

    --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)