2013-08-02 154 views
0

我有這個存儲過程做全文索引搜索與INFLECTIONAL支持。 下面的代碼似乎有兩個單詞拋出錯誤消息的問題。多字全文索引搜索 - sql

沒有錯誤

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''. 

能有人告訴我正確的語法?

+0

我找到了答案。在關鍵字中使用雙引號(「)而不是單引號 – mercu

回答

0

當您搜索短語時,您必須使用雙引號,但是您改爲使用兩個單引號。 試試這個:

INNER JOIN CONTAINSTABLE (ProductRequest, 
(Abstract , Cause , Description), 
'FORMSOF(INFLECTIONAL,"email address") OR "windowsproduct"') AS KEY_TBL 
+0

是的,非常感謝。:) – mercu