I have the following where clause:
B.GivenName=@GivenFirstName)
or ((@GivenFirstName = '""')
or (@GivenFirstName is null))
or (B.GivenName like +'%'+ @GivenFirstName)
or (B.GivenName like @GivenFirstName + '%' )
or (B.GivenName like + '%'+ @GivenFirstName + '%' )
or (CONTAINS(B.GivenName, @GivenFirstName,LANGUAGE 'german'))
If a firstname is not entered into the search I get the error:
Msg 7645, Level 15, State 2, Procedure Search_test, Line 179
Null or empty full-text predicate.
I tried wrapping the @GivenFirstName in
COALESCE(@GivenFirstName, '""')
but it doesn’t work either.
Is there some way I can use @GivenFirstName OR ‘””‘ if @GivenFirstName is null inside the where clause?
Thanks,
Thomas
thanks for the help everyone. I was originally using this so that when accented characters such as é are entered into the search they still return results without accents and vice versa..
I ended up just using a strip accents function like so: