Link to home
Start Free TrialLog in
Avatar of yleviel
ylevielFlag for Argentina

asked on

PatIndex Problem

I've been recently looking for a way to see if a keyword is used within a given text in the database and have been using PatIndex to check if that word exists... problem is, when I search for PatIndex('%car%', @SearchText), if the searchtext has the word cartridge, it also picks it up.  I have tried using two spaces, one at the begining and one at the end... but that causes car's to be rejected...

Any help is much appreciated.
ASKER CERTIFIED SOLUTION
Avatar of nigelrivett
nigelrivett

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yleviel

ASKER

In the end I used:

patindex('%[^A-Za-z]car[^A-Za-z]%'...