I'm trying to do some query performance and I've been looking into applying a FULLTEXT INDEX as compared to using LIKE.
I have a database w/person information, i.e. FirstName, LastName, etc. where some of those columns are null.
When I try to use CONTAINS object, I'm getting this error message;
Null or empty full-text predicate
I've put in code to ensure the passed in @FirstName field is not null, and if a null was passed in then I've set it to ' "" ' like I've read elsewhere. I still get the error message. I'm starting to wonder if it's a problem because the index has columns that are null.
Does anyone know if that is the case, I've looked everywhere and I cannot find any information on this.
Here is the query. The @FirstNameLocal and @LastNameLocal are passed into this stored procedure. In this example, FirstName and/or LastName field data in the PersonTable could be null. I'm using SQL Server 2012 w/SP1. "Try to use" means when I try to run the query in SQL Management Studio.
SELECT DISTINCT LastName, FirstName, MiddleName, PersonId
FROM PersonTable
Where IsDeleted = 0
AND CONTAINS(FirstName, @FirstNameLocal)
AND CONTAINS(LastName, @LastNameLocal)