How do you escape double quotes inside a SQL fulltext 'contains' function?

Posted by Richard Davies on Stack Overflow See other posts from Stack Overflow or by Richard Davies
Published on 2010-05-21T22:28:56Z Indexed on 2010/05/21 22:30 UTC
Read the original article Hit count: 196

Filed under:
|
|

How do you escape a double quote character inside a MS SQL 'contains' function?

SELECT decision
FROM table 
WHERE CONTAINS(decision, '34" AND wide')

Normally contains() expects double quotes to surround an exact phrase to match, but I want to search for an actual double quote character. I've tried escaping it with \, `, and even another double quote, but none of that has worked.

P.S. I realize a simple example like this could also be done using the LIKE statement, but I need to use the fulltext search function. The query I provided here has been simplified from my actual query for example purposes.

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server