4

I need to fetch all records which contain .

At the moment I use this SQL:

  select * from dbo.mytable
    where CONTAINS(Location, '.')

but I receive this error:

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

I cannot set column full text indexed as I do not have high privilege.

Any idea how to circumnavigate this problem?

GibboK
  • 71,848
  • 143
  • 435
  • 658
  • 1
    Please add a comment when down-voting. Glad to edit my question. – GibboK Jun 06 '14 at 09:33
  • How about using `PATINDEX` sort of [that way](http://stackoverflow.com/questions/9772566/using-patindex-to-find-varying-length-patterns-in-t-sql)? – xacinay Jun 06 '14 at 09:37

1 Answers1

5

If you want to use CONTAINS the column needs to be full-text indexed.

If you don't, or can't, then you can search for data containing a . using LIKE

 where Location LIKE '%.%'
podiluska
  • 50,950
  • 7
  • 98
  • 104