Computing.Net > Forums > Web Development > sql question, case insensitive LIKE

sql question, case insensitive LIKE

Reply to Message Icon

Original Message
Name: Shmanda
Date: December 7, 2005 at 14:41:26 Pacific
Subject: sql question, case insensitive LIKE
OS: WinXPPro
CPU/Ram: plenty
Comment:

Hi - I hope this is the right place to ask. I have what will probably turn out to be a dumb SQL question...

I found out our SQL Server installation is case sensitive. I'm trying to do a query on a text field using LIKE. I want all results back, regardless of case.

SELECT * FROM table WHERE note LIKE %word%

Here I only get the lower case back. Is there any way to make it ignore case? All I can find online are solutions to the opposite problem.

I've tried to do WHRE LIKE %word% OR LIKE %WORD% but it doesn't let me. Is it even possible to do two LIKEs in that way?
It won't let me do UPPER on a text field. I tried a crazy query using SUBSTRING to get it all upper case but then I couldn't use LIKE. Help!


Report Offensive Message For Removal

Response Number 1
Name: Shmanda
Date: December 8, 2005 at 14:07:49 Pacific
Subject: sql question, case insensitive LIKE
Reply: (edit)

Ok no replies :(

I'll post my workaround anyway in case anyone is looking for one..

I created another view where I did:
UPPER(SUBSTRING(note, 1, 8000)) where it made everything upper case. Then I selected from that view instead of from the original table.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: sql question, case insensitive LIKE

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software