I am trying to combine several columns from a constant table into one column of a table variable so that I can run contains ("foo" and "bar") and get the result, even if foo is not in the same column as the bar.
however, it is not possible to create a unique index for a table variable, so the full index to run a does not contain.
Is there a way to dynamically merge multiple columns and run them on them? here is an example:
declare @t0 table ( id uniqueidentifier not null, search_text varchar(max) ) declare @t1 table ( id uniqueidentifier ) insert into @t0 (id, search_text) select id, foo + bar from description_table insert into @t1 select id from @t0 where contains( search_text, '"c++*" AND "programming*"' )
source share