SELECT * FROM Table WHERE Contains(Column, N'"But*"') Not Working



  • SELECT * FROM Table WHERE Contains(Column, N'"But*"') Not Working

    Although the Column Contains values such as:   But, Test But, Test But New, etc.....

    Similarly its not working for values like "And", "Or", "If", etc.

    Can anyone tell me the reason, why its not working?

                                                                          



  • If this is MSSQL, because those words are defined as noise words and as such are not used in full text searches.  You can remove them from the noise word list, but it may have other consequences like drastically increasing the size of the index and decreasing performance.  In MSSQL 2005, go to the install directory typcially c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData\ and there are noise config files for each language.  I think you just need to remove those entries and rebuild the index, although you may need to bounce the services.

    If you're using  MSSQL 2008, noise words have been replaced by stopwords and stoplists.  I haven't created or altered any of them yet, but if you check the Books On Line, it should point you in the right direction.



  • thanks Edward


Log in to reply