영구 테이블의 여러 열을 테이블 변수의 한 열로 연결하여 contains ("foo"및 "bar")를 실행할 수 있고 foo가 bar와 같은 열에 있지 않아도 결과를 얻을 수 있습니다.은 테이블 변수 또는 임시 테이블을 통한 검색을 포함합니다.
그러나 테이블 변수에 고유 인덱스를 만들 수 없으므로 contains를 실행하는 전체 텍스트 인덱스가 없습니다.
동적으로 여러 열을 연결하고 포함을 실행하는 방법이 있습니까? 그것은이 같은
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 버전입니까? –
sql server 2008 sp1 – noobsaibot