Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

CROSS APPLY a FREETEXTTABLE

$
0
0
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!

CREATEFUNCTION fnt_FullTextSearch ( @s NVARCHAR(4000) )RETURNSTABLEASRETURN
  ( SELECT [key], [rank]FROMFREETEXTTABLE(table1, *, @s) )DECLARE @terms TABLE ( term VARCHAR(MAX) )INSERTINTO @terms VALUES ( 'flu' )INSERTINTO @terms VALUES ( 'acid' )--The inline function "..." cannot take correlated parameters or subqueries-- because it uses a full-text operator.SELECT ft.[key], ft.[rank]FROM @terms CROSS APPLY fnt_FullTextSearch(term) ft--syntax error on termSELECT ft.[key], ft.[rank]FROM @terms CROSS APPLY FREETEXTTABLE(table1, *, term)


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>