tags:

views:

384

answers:

2

Hi,

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 CONTAINSTABLE() so that it matches all records in a table.

Kind regards,

+1  A: 

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.

mrdenny
+1  A: 

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

IF @searchterm='*' 
    SELECT * FROM YOURTTABLE
ELSE
    SELECT * FROM YOURTABLE INNER JOIN CONTAINSTABLE etc
END IF
ctrlalt3nd