Username increment by 1 if already exists in table

  • Agreed. Not sure how it turned out for the OP but this is one where I would push back or at least wipe my hands clean of the bug being knowingly created in light that there is a better way (no intelligent keys). Intelligent keys are more of what I like to think of as a entity short name field (Along with the Id and the entity long name fields).

    ----------------------------------------------------

  • crmitchell - Tuesday, January 17, 2017 6:25 AM

    MMartin1 - Wednesday, November 9, 2016 11:59 AM

    What is the rule if you have three people named Bo Derek, or four people named Joe Smith? In the prior code run I see that the last one gets missed. That is why I am not a fan of "intelligent keys" and would prefer to simply use some numeric identifyer for the person. Is it that you are wanting to assign email addresses ?

    They don't even all need to be the same

    John Smith
    Joseph Smith
    Jo Smith

    will have a problem with the third name (although a different order would still work)

    There are relatively simple ways to get around this situation, but the OP never specified how he wanted to handle them, so I didn't incorporate them into my solution.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 2 posts - 31 through 31 (of 31 total)

You must be logged in to reply to this topic. Login to reply