SQL Server Free Text Search with multiple search words inside a stored procedure


  • I am trying to do a free text search. basically the search string is being sent to a stored procedure where it executes the free text search and returns the result.

    If I search for red flag, I want to return the results that matches both red and flag text.

    Below is the query I use to return the results.

    select * from customer where FREETEXT (*, '"RED" and "flag"')

    This doesn't give me the desired result. Instead this one give the desired result.

    select * from customer where FREETEXT (*, 'RED') AND FREETEXT (, 'FLAG')

    My problem is since it's inside a stored procedure, I will not be able to create the second query where clause. I thought both query should return the same result. Am I doing something wrong here?

    • Moved by Kalman Toth Saturday, December 14, 2013 12:38 AM Not t-sql
    Friday, December 13, 2013 11:27 PM

All replies