0

I'm just starting out with full text searching and I've always used wildcards in the past. Here's a query I have:

SELECT rID, claimID+counter FROM claims WHERE claimID+counter LIKE '%ba%' AND (status='submitted' OR status='closed')

I'm trying to convert this to contains but I get an error saying that the column doesn't exist.

SELECT rID, claimID+counter FROM claims WHERE contains(claimID+counter,'ba') AND (status='submitted' OR status='closed')

I tried the above and no go. How do i fix this?

Damien
  • 4,093
  • 9
  • 39
  • 52

1 Answers1

0

Try this

SELECT rID, claimID+counter FROM claims WHERE contains((claimID,counter),'ba') AND (status='submitted' OR status='closed')

If you get error running above script like

Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'claims' because it is not full-text indexed.

Then make sure you have full-text search feature installed. Follow this Link for more detail

Community
  • 1
  • 1
DevelopmentIsMyPassion
  • 3,541
  • 4
  • 34
  • 60