table_beatles contains the following data in column name.
- John
- PAUL
- george
- RINGO
In MS-SQL is there anyway to get any item which is all caps? eg
SELECT * FROM table_beatles where name is (AllCaps SYNTAX HERE)
to return PAUL and RINGO.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How you do this depends on the collation used. If you have a case insensitive collation, you are asking SQL to treat lower and upper case the same. So you may need to do this:
This forces SQL to use a case sensitive (CS) comparison for the equality check. If you already have a case sensitive collation, then you can omit the two
COLLATEparts of this. But given you’ve asked the question, I’m guessing you haven’t.