Skip to content Skip to sidebar Skip to footer

Containstable And Contains, Which String To Pass To Match All Records?

We have a Single Statement FUNCTION in SQL Server 2005 which uses CONTAINSTABLE(). All works fine when we pass a non empty search string. Is there a wildcard string we can pass to

Solution 1:

You have to use logic within the stored procedure to run a SQL statement without the CONTAINSTABLE predicate if there isn't a full text phrase to search by.

Solution 2:

I don't think there is, you'd have to do something like (psuedocode)

IF @searchterm='*'SELECT*FROM YOURTTABLE
ELSESELECT*FROM YOURTABLE INNERJOIN CONTAINSTABLE etc
END IF

Post a Comment for "Containstable And Contains, Which String To Pass To Match All Records?"