• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

Case insensitive search

HI all..

I am working with SQL 2000 and have a search problem. In the past I used to be able to do a search with out worring about case, but the server here seems to be case sensitive.

A simple query like

select * from staff
where
 Name LIKE 'g%'

will not return the name 'Graeme'. it wants a 'G'.

My Question is - how do I perform a case-insenitive search in my query?

Thanks
0
ggets
Asked:
ggets
1 Solution
 
isondCommented:
Try

select * from staff
where
Name like '[Vv]%'

Darren.

0
 
isondCommented:
Sorry that last post does not seem clear. The Vv looks like W.

Hear it is again.
Try

select * from staff
where
Name like '[Gg]%'

Darren.

0
 
ibroCommented:
Try this:

select * from staff
where
upper(Name) LIKE 'G%'

But if you want to imporove performance in cases like this, always store the names in upper (lower) case, so you will gain performance from index search.
hope this helps
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
mcmahon_sCommented:
Try:

SELECT * FROM STAFF
WHERE UPPER(NAME) LIKE 'G%'
0
 
mcmahon_sCommented:
oops, ibro beat me to it
0
 
ggetsAuthor Commented:
This works for me..

Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now