I'm trying to use SQL CONTAINS function with variables. Usually, I can use CONTAINS the following way:
WHERE CONTAINS(tablename, '"some text to search for"')
However, I can't figure out how to insert a variable inside that function that would allow me to search with multiple words.
WHERE CONTAINS(tablename, @Keyword)
only allows to search for one word and will throw an exception if multiple words are passed to it.
Msg 7630, Level 15, State 3, Procedure dbo.bp_SearchCategoryByKeyword, Line 11 [Batch Start Line 0] Syntax error near 'this' in the full-text search condition