Locate upper case characters in SQL Server database field

前端 未结 4 482
猫巷女王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:48

    You can do a binary comparison using:

    select *
    from Cust
    where cast(Surname as varbinary(120)) != cast(lower(Surname) as varbinary(120))
    

提交回复
热议问题