Groups | Blog | Home
all groups > sql server (alternate) > february 2004 >

sql server (alternate) : Contains Predicate and Double Quotes


swtwllm NO[at]SPAM alum.iup.edu
2/20/2004 10:36:21 AM
I have been searching for an escape character or a way of escaping
double quotes that are actually in a string that I am using in the
contains predicate.

Here is an example

select *
from table
where contains(field, '"he said "what is wrong", that is what he
said"')

I need the double quotes in the string because they are part of the
text. Of course, Fulltext search raises the error

Server: Msg 7631, Level 15, State 1, Line 1
Syntax error occurred near 'what is wrong", that is what he said'.
Expected ''''' in search condition '"he said "what is wrong", that is
what he said"'.

If I remove the double quotes, the search does not return the proper
results.

Thanks in advance for the help
Erland Sommarskog
2/20/2004 10:29:01 PM
swtwllm (swtwllm@alum.iup.edu) writes:
[quoted text, click to view]

I would expect doubling the quotes would help, but I don't use full-text
myself, so I don't know.

microsoft.public.sqlserver.fulltext may a better place to ask.


--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
Simon Hayes
2/20/2004 11:16:30 PM

[quoted text, click to view]

It looks like this has been answered in
microsoft.public.sqlserver.fulltext - please don't post to multiple
newsgroups separately.

Simon

AddThis Social Bookmark Button