我想使用带符号符号的CONTAINS搜索,但我可以找到虽然表中有数据。我该如何使用它,有什么补救措施吗?
E.g:
DECLARE @Author NVARCHAR(200) = N'&'
SET @Author = '"' + REPLACE(@Author, ' ', '*" and "') + '*"'
SELECT *
FROM dbo.Taxonomy AS t (NOLOCK)
WHERE CONTAINS(t.Author, @Author)
但不返回结果:(
答案 0 :(得分:0)
试试这个:
DECLARE @Author NVARCHAR(200) = N'"&"'
SET @Author = '"' + REPLACE(@Author, ' ', '*" and "') + '*"'
SELECT *
FROM dbo.Taxonomy AS t (NOLOCK)
WHERE CONTAINS(t.Author, @Author)