Syntax error near 'of' in the full-text search condition 'control of'

后端 未结 1 1442
广开言路
广开言路 2021-02-02 09:03

I have the following WHERE clause:

WHERE (@Keywords IS NULL
            OR (CONTAINS((p.Title, p.Area, p.[Message]), @Keywords))
        )


        
相关标签:
1条回答
  • 2021-02-02 09:29

    Enclose the keywords in double quotes if you want to search exactly for control of

    SET @Keywords = '"control of"'
    

    If you want to search for control and of, use the following:

    SET @Keywords = 'control AND of'
    

    But server may consider of as a garbage or stop word, so in this case use the following:

    SET @Keywords = 'control AND "of"'
    
    0 讨论(0)
提交回复
热议问题