Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Other SQL Server Topics / October 2007

Tip: Looking for answers? Try searching our database.

CONTAINS and wildcard

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sharif Islam - 29 Oct 2007 21:59 GMT
Is it a good idea to have multiple contains? I have this query:

Select * from myTable where contains (Col1, 'Africa') or (Col2, 'Africa')

Also, I tried this, didn't return anything:

Select * from myTable where contains (Col1, 'Africa*') or (Col2, 'Africa')

Both Col1 and Col2 has the string 'Africa' and 'African' in it.

--sharif
jhofmeyr@googlemail.com - 30 Oct 2007 00:51 GMT
> Is it a good idea to have multiple contains? I have this query:
>
[quoted text clipped - 7 lines]
>
> --sharif

Hi Sharif,

What version of SQL Server are you using?  What is the error message
you are getting? Is the table configured for Full-Text Indexing?

Also - your syntax for the CONTAINS statement is incorrect. Try:
SELECT *
FROM myTable
WHERE CONTAINS(Col1, '"Africa*"')
OR CONTAINS(Col2, '"Africa*"')

Good luck!
J
Sharif Islam - 30 Oct 2007 15:07 GMT
>> Is it a good idea to have multiple contains? I have this query:
>>
[quoted text clipped - 18 lines]
> WHERE CONTAINS(Col1, '"Africa*"')
> OR CONTAINS(Col2, '"Africa*"')

ah, that was it, thanks!

--sharif
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.