I have a stored procedure that takes an input parameter as follows:
@Name NVARCHAR(50) = 'George W Bush'
How can I adjust my where clause dynamically:
SELECT * FROM TABLE
WHERE CONTAINS(FIELD, 'George')
AND CONTAINS(FIELD, 'W')
AND CONTAINS(FIELD, 'Bush')
Or for example:
@Name NVARCHAR(50) = 'Harry Potter'
SELECT * FROM TABLE
WHERE CONTAINS(FIELD, 'Harry')
AND CONTAINS(FIELD, 'Potter')
I have found many solutions here that come so close to doing what I need, but I specifically need for the field to contain each substring of the input parameter.