0

I using SqlServer Full Text Search. In my website, user can input search term, and I looking for it.

I noticed that several symbols, such as tilda ('~') cause sql server to throw the following error:

Syntax error near ')' in the full-text search condition '(~~) 

What is the correct way to deal with this?

Illidan
  • 4,047
  • 3
  • 39
  • 49
  • Do you use String concatenation to build the search query? – Quy Tang Jul 23 '16 at 07:12
  • Refer this post to achieve what you want - http://stackoverflow.com/questions/258757/escape-a-string-in-sql-server-so-that-it-is-safe-to-use-in-like-expression – Quy Tang Jul 23 '16 at 07:14

1 Answers1

0

I did 2 changes. Not sure which one fixed this issue, but now it is fine:

  1. I changed CONTAINSTABLE to FREETEXTTABLE
  2. I wrapped my search querywith "".

Hope this will help someone.

Illidan
  • 4,047
  • 3
  • 39
  • 49