?
Solved

PatIndex Problem

Posted on 2003-02-25
2
Medium Priority
?
364 Views
Last Modified: 2008-03-06
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.
0
Comment
Question by:yleviel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
nigelrivett earned 150 total points
ID: 8022055
I think you want to look at full text search.

also

where patindex('[ ',;:,]car[ ',;:]', ' ' + fld + ' ') <>0

or maybe

where patindex('[^A-Z^a-z]car[^A-Z^a-z]', ' ' + fld + ' ') <>0
0
 
LVL 2

Author Comment

by:yleviel
ID: 8025717
In the end I used:

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question