sql - How to find more than 1 uppercase character -


i'm running series of sql queries find data needs cleaning up. 1 of them want for:

  • 2 or more uppercase letters in row
  • starting lowercase letter
  • space lowercase letter

for example name should "john doe". want find "john doe" or "john doe" or "john doe", not want find "john doe" since formatted correctly.

i using sql server 2008.

the key use case-sensitive collation, i.e. latin1_general_bin*. can use query like expression following (sql fiddle demo):

select * foo name '%[a-z][a-z]%' collate latin1_general_bin --two uppercase in row or name '% [a-z]%' collate latin1_general_bin --space lowercase 

*as per how perform case-sensitive search using like?, apparently there "bug" in latin1_general_cs_as collation ranges [a-z] fail case sensitive. solution use latin1_general_bin.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -