我试图将持久表中的多个列连接成表变量的一列,以便我可以运行一个包含(“foo”和“bar”)和即使foo与bar不在同一列,也会得到结果。包含对表变量或临时表的搜索
但是,无法在表变量上创建唯一索引,因此无法运行包含的全文索引。
有没有办法动态地连接几个列并在其上运行一个包含?这里有一个例子:
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*"')
你是什么版本的SQL Server? – 2010-08-03 15:29:31
sql server 2008 sp1 – noobsaibot 2010-08-03 15:39:58