0

我有这个存储过程,可以做全文索引搜索,支持 INFLECTIONAL。下面的代码似乎有两个单词抛出错误消息的问题。

没有错误

INNER JOIN  CONTAINSTABLE (ProductRequest, (Abstract , Cause , Description ), 'FORMSOF(INFLECTIONAL,''emailaddress'') OR ''windowsproduct''' ) AS KEY_TBL

语法错误

//Note the white space in email address
INNER JOIN  CONTAINSTABLE (Table2, (Abstract , Cause , Description ), 'FORMSOF(INFLECTIONAL,''email address'') OR ''windowsproduct''' ) AS KEY_TBL
//Msg 7630, Level 15, State 3, Line 1
//Syntax error near 'ddress'' in the full-text search condition 'FORMSOF(INFLECTIONAL,'emaila ddress') OR 'windowsproduct''.

//Note the white space at the end of email address
INNER JOIN  CONTAINSTABLE (Table2, (Abstract , Cause , Description ), 'FORMSOF(INFLECTIONAL,''emailaddress '') OR ''windowsproduct''' ) AS KEY_TBL
//Msg 7630, Level 15, State 3, Line 1
//Syntax error near ''' in the full-text search condition 'FORMSOF(INFLECTIONAL,'emailaddress ') OR 'windowsproduct''.

有人可以告诉我正确的语法吗?

4

1 回答 1

0

当您搜索一个短语时,您必须使用双引号,但您使用的是两个单引号。尝试这个:

INNER JOIN  CONTAINSTABLE (ProductRequest, 
 (Abstract , Cause , Description ), 
 'FORMSOF(INFLECTIONAL,"email address") OR "windowsproduct"' ) AS KEY_TBL
于 2013-08-02T12:46:12.437 回答