473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Contains Predicate and Double Quotes

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
Bill
Jul 20 '05 #1
2 6794

"swtwllm" <sw*****@alum.iup.edu> wrote in message
news:c3**************************@posting.google.c om...
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
Bill


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

Simon
Jul 20 '05 #2
swtwllm (sw*****@alum.iup.edu) writes:
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.


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, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jakanapes | last post by:
Hi all, I'm looking for a way to scan a block of text and replace all the double quotes (") with single quotes ('). I'm using PHP to pull text out of a mySQL table and then feed the text into...
4
by: hall | last post by:
I accidently overloaded a static member function that I use as predicate in the std::sort() for a vector and ended up with a compiler error. Is this kind of overload not allowed for predicates and...
18
by: Bill Smith | last post by:
The initial row is inserted with the colPartNum column containing a valid LIKE pattern, such as (without the single quotes) 'AB%DE'. I want to update the column value with the results of a query...
4
by: (PeteCresswell) | last post by:
Is his just a flat-out "No-No" or is there some workaround when it comes time for SQL searches and DAO.FindFirsts against fields containing same? I can see maybe wrapping the value searched for...
8
by: Ahmad A. Rahman | last post by:
Hi all, I have a problem constructing a regular expression using .net. I have a string, separated with comma, and I want to group the string together but, I failed to group a numeric character...
7
by: gar | last post by:
Hi, I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code text= Replace(text, """", "'" This works fine (for normal double quotes).The problem...
14
by: Ralf Rottmann \(www.24100.net\) | last post by:
I recently stumbled across a pretty interesting LINQ to SQL question and wonder, whether anybody might have an answer. (I'm doing quite some increasing LINQ evangelism down here in Germany.). ...
3
by: jason.cipriani | last post by:
How can I use my own custom comparison function with std::list::sort()? The only call to sort() I see does not take a predicate argument. Specifically, I have: list<pair<double,MyType ...; ...
2
by: Denise | last post by:
Front end is Access 2002, back end is linked Oracle tables. My users need to describe things in feet and inches and want to use the standard ' and " abbrevations. On a testing form I go to a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.