Locate upper case characters in SQL Server database field

前端 未结 4 479
猫巷女王i
猫巷女王i 2021-01-18 12:06

I need to locate rows in a database table that have a field with an upper case value.

E.g.: select * from Cust where Surname like \'COnTAiNS UpPERcASE VaLUe         


        
4条回答
  •  迷失自我
    2021-01-18 12:26

    You could do something like this:

    SELECT 
     CASE WHEN BINARY_CHECKSUM('yourStriNg') = BINARY_CHECKSUM(LOWER('yourStriNg')) 
         THEN 0 
         ELSE 1 
     END
    

    ....

    Rest of SQL statement

提交回复
热议问题