You are here: Re: CONTAINS and wildcard « MsSQL Server « IT news, forums, messages
Re: CONTAINS and wildcard

Posted by jhofmeyr on 10/29/07 23:51

On Oct 29, 8:59 pm, Sharif Islam <mis...@npspam.uiuc.edu> wrote:
> 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

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация