2

I found this question here on how to find all uppercase characters in an SQL field. How to find values in all caps in SQL Server?

The query explained there seems to work great, but is there a better technique to not find words that naturally are all uppercase?

For example presume a name field. "A" could be valid. "AJ" could be valid.

Also, expanding to other mistakes involving lowercase: "StEVE" is not valid. "steve" is not valid. But "McMillan" or "Mc Millan" could be valid.

Is there any techniques in SQL to find these mistakes? This is using MS SQL Server.

user3513237
  • 995
  • 3
  • 9
  • 26
  • 4
    Take a peek at https://stackoverflow.com/questions/54239873/i-want-to-update-values-of-a-column-in-a-table-to-title-case/54240287#54240287 This is a broad and never ending discussion – John Cappelletti Aug 22 '19 at 17:39
  • 1
    Any discussion about names deserves a link to this article. https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ – Sean Lange Aug 22 '19 at 18:09
  • IMHO, this requires some serious AI capabilities to get right. The rules of proper capitalization are so convoluted and context dependent that it's fighting a loosing battle, especially if you have names from multiple cultures. I mean, for an English speaker, Steve is obviously a name, but what about Nobel prize winner for literature in 2007 - Kazuo Ishiguro - or Indian names such as Mokesh, Pradeep, or Hebrew names such as Ehud or Zohar? Would you know which one is a a name and which one is just a phonetic transcript of some word in a language you don't now? – Zohar Peled Aug 22 '19 at 20:40
  • @ZoharPeled well all your examples look formatted correctly, even though they are from other cultures...i.e. capitalized first letter, not like STEVE or STevE or StEvE. I am starting with detecting all lowercase names and all uppercase as a start since those seem obviously wrong. – user3513237 Aug 23 '19 at 15:01
  • Yes, the are, but my point is that if you see 'mokesh' or 'ronen' or 'yedidya' how do you know it's a name in the first place? – Zohar Peled Aug 23 '19 at 16:00

0 Answers0