Mostafa Elmoghazi
Mostafa Elmoghazi

Reputation: 2154

Searching for a phrase using SQL Server Full text search

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.

Upvotes: 0

Views: 768

Answers (2)

madC
madC

Reputation: 243

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.

Upvotes: 0

Jerry Coffin
Jerry Coffin

Reputation: 490128

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'

Upvotes: 2

Related Questions