Hello Dave,
You are right about AND operator in CONTAINS and CONTAINSTABLE Predicate
where <Search Condition1> AND <Search Condition2>
will be TRUE only if both conditions are in the same column mentioned in
the predicate. However if you mention * insead of the column name
then search condition with AND operator applies to all the columns which
are candidates for FTS.
However, for FREETEXT AND FREETEXTABLE , the <free text string> does not
recognize AND as a boolean operator and you can't use it.
For AND operation where search conditions in the same expression exists in
diff columns of the table, you need to implement it using a Sql Query.
E.G,
USE NORTHWIND
GO
SELECT ProductName
FROM Products
WHERE UnitPrice = 15.00
AND CONTAINS(QuantityPerUnit, 'boxes')
AND CONTAINS(ProductName, ' "choc*" ')
GO
Please let me know if that answers your question.
Thanks for posting to MSDN Managed Newsgroup.
Thanks,
Vikrant Dalwale
Microsoft SQL Server Support Professional
This posting is provided "AS IS" with no warranties, and confers no rights.
Get secure !! For info, please visit
http://www.microsoft.com/security.
Please reply to Newsgroups only.
--------------------
Content-Class: urn:content-classes:message
From: "dave" <dy@onlinelg.com>
Sender: "dave" <dy@onlinelg.com>
References: <02****************************@phx.gbl>
<F3**************@cpmsftngxa06.phx.gbl>Subject: RE: ASP.NET and SQL 2000 FULL Text Search Results
Date: Fri, 29 Aug 2003 09:46:56 -0700
Lines: 11
Message-ID: <01****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNuTShlfeGHyHVSRxi87UgM86a6xw==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:106614
NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
X-Tomcat-NG: microsoft.public.dotnet.general
I read the following somewhere on the web...
For Contains and ContainsTable you are correct. The
boolean AND will only work when both hits are in the same
column. For FreeText and FreeTextTable the query and
boolean operators can look across columns.
Is the something wrong with the above approach?
thx
dave