CROSS APPLY a FREETEXTTABLE

  • table1 has a full text index. I want to run multiple freetexttable searches against it in a single query, but the two attempts i have fail. any help would be appreciated, thanks!

    CREATE FUNCTION fnt_FullTextSearch ( @s-2 NVARCHAR(4000) )

    RETURNS TABLE

    AS

    RETURN

    ( SELECT , [rank]

    FROM FREETEXTTABLE(table1, *, @s-2) )

    DECLARE @terms TABLE ( term VARCHAR(MAX) )

    INSERT INTO @terms VALUES ( 'flu' )

    INSERT INTO @terms VALUES ( 'acid' )

    --The inline function "..." cannot take correlated parameters or subqueries

    -- because it uses a full-text operator.

    SELECT ft., ft.[rank]

    FROM @terms

    CROSS APPLY fnt_FullTextSearch(term) ft

    --syntax error on term

    SELECT ft., ft.[rank]

    FROM @terms

    CROSS APPLY FREETEXTTABLE(table1, *, term)

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply