Tame Those Strings! Part 5 - Proper Casing Strings

  • And there are the O'Briens, van der Veldes and the d'Arcys to consider. Never ending, this one!

     

    --
    Scott

  • If you're talking about just proper-casing, then names beginning with O' give you a built-in hint.  Capitalize the O and capitalize the letter following the apostrophe.  If you're looking at searching for O'Reilly in your database, then the best bet might be to phonetically encode.

    I would probably do all the proper-casing client side, like before the records were input.  You'll probably get much better performance with a client-side programming language with an optimized string manipulation library.  However, if I absolutely had to do it SQL Server-side, I'd build a table containing all my exceptions to keep it as simple and efficient as possible.

  • 'Van', 'Von', 'Di', 'De', 'La', 'Li', to name a few...

  • Thanks for the excellent thread.  Kudos to Steve Jones, SAinCA and all the other contributors.  Your time and efforts are very much appreciated!

    We are migrating from our UNIX based db to Sql Server. All char fields are in upper case.  Fortunately UNIX db had a builtin InitCaps function.  This thread has saved me a huge amount of time since for some reason MS Sql Server requires that we "Roll our Own".  Naturally everything has to happen YESTERDAY !!!  So finding a gem like this is Hot S##T !!

    MS sure makes me wonder.  Every db system has it warts but Sql Server, so awsome in so many ways, has really surprised me with omissions of such typically handy 'native' functions like InitCap and Trim.  DBase and FoxPro had InitCap, Trim and bunches of other handy functions back in the late 80's. Go figure.

    Thank GOD for these forums!  Hope I have the chance to give-back in the future.

    Barry

    in Oregon

     

Viewing 4 posts - 16 through 18 (of 18 total)

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