views:

165

answers:

2

I want to use SQL SERVER 2008 Full text search to get the records that have a word or a phrase as the whole text within the field and not as part of the text within the field. For example: I have many records containing the Word 'Inheritance' as the whole text in the field and other fields containing the same word in between,at the beginning, and at the end of the text within the field. I want to get only the records containing the 'Inheritance' word as the whole text in the record.

Thank you.

+2  A: 

If you just want the rows in which a particular field exactly matches a specified string, you don't need to use full-text searching at all, just a normal SQL query:

select * from the_table where the_field = 'inheritance'
Jerry Coffin
The table I am searching has 500 million records and the field is nvarchar(max).The performance of the full-text search is better significantly than using the = operator in this case.
SubPortal
A: 

According to the documentation this should work,

WHERE CONTAINS(thefield, '"Inheritance*" AND NOT "Inheritance *"');

Couldn't test it here since we don't have any full text search enabled databases.

madC