Hi folks,
I'm trying to create the following sql query (as in, this is an example of the final query) :-
DECLARE @SearchQuery AS NVARCHAR(100) = 'yellow bird'
SELECT Id, Name
FROM dbo.FooBars
WHERE CONTAINS(Name, N'FORMSOF(Thesaurus, yellow)')
AND CONTAINS(Name, N'FORMSOF(Thesaurus, bird)')
Notice how i've got two 'CONTAINS' lines? This is because the search query has two words in it. (a space is the delimeter). This query could be from 1 to n words.
How can i generate this sql code based upon the number of words in the search query?